public static Category FromDbEntity(SqlEntity.Category sqlCategory) { if (sqlCategory == null) { return(null); } return(new Category { Id = sqlCategory.Id, Name = sqlCategory.Name }); }
public static Account FromDbEntity(SqlEntity.Account account, SqlEntity.Category category, SqlEntity.Subcategory subcategory) { return(new Account { Id = account.Id, Name = account.Name, NormalSide = (NormalSide)account.NormalSide, BeginningBalance = account.BeginningBalance, Balance = account.Balance, Debit = account.Debit, Credit = account.Credit, Comment = account.Comment, Order = account.Order, Active = account.Active == 1, Category = Category.FromDbEntity(category), Subcategory = Subcategory.FromDbEntity(subcategory), AccountId = account.AccountId, ContraAccount = account.ContraAccount == 1 }); }