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

27 lines
643 B
C#

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 double Sum { get; private set; }
public DateTime Date { get; private set; }
public int ExpenseCategoryId { get; private set; }
public static Expense CreateExpense(int id, double sum, int expenseCategoryId)
{
return new Expense
{
Id = id,
Sum = sum,
Date = DateTime.Now,
ExpenseCategoryId = expenseCategoryId
};
}
}