Пример #1
0
 public static IngredientAmountEntity MapEntity(IngredientAmountDetailModel model) =>
 new IngredientAmountEntity
 {
     Id         = model.Id,
     Amount     = model.Amount,
     Unit       = (CookBook.DAL.Enums.Unit)model.Unit,
     Ingredient = IngredientMapper.MapEntity(model)
 };
Пример #2
0
        public static IngredientAmountEntity MapEntity(IngredientAmountDetailModel model,
                                                       IEntityFactory entityFactory = null)
        {
            var entity = (entityFactory ??= new DummyEntityFactory()).Create <IngredientAmountEntity>(model.Id);

            entity.Id         = model.Id;
            entity.Amount     = model.Amount;
            entity.Unit       = (DAL.Enums.Unit)model.Unit;
            entity.Ingredient = IngredientMapper.MapEntity(model, entityFactory);
            return(entity);
        }