PIBD-23_Fomichev_V.S._Famil.../ProjectFamilyBudget/Entities/Expense.cs

27 lines
644 B
C#
Raw Normal View History

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ProjectFamilyBudget.Entities;
public class Expense
{
public int Id { get; private set; }
public decimal Sum { get; private set; }
public DateTime Date { get; private set; }
public int ExpenseCategoryId { get; private set; }
public static Expense CreateEntity(int id, decimal sum, int expenseCategoryId)
{
return new Expense
{
Id = id,
Sum = sum,
Date = DateTime.Now,
ExpenseCategoryId = expenseCategoryId
};
}
}