コード例 #1
0
        public FortifiedWine Add(FortifiedWine model)
        {
            var entity           = FortifiedWineEntity.Map(model);
            var newFortifiedWine = _dataContext.FortifiedWines.Add(entity).Entity;

            _dataContext.SaveChanges();
            return(FortifiedWineEntity.Map(newFortifiedWine));
        }
コード例 #2
0
        public FortifiedWine Get(int id)
        {
            var entity = _dataContext.FortifiedWines.Find(id);

            return(entity == null ? null : FortifiedWineEntity.Map(entity));
        }