Ejemplo n.º 1
0
 public void Update(T obj)
 {
     if (!Equals(obj, null))
     {
         T origin = GetById(obj.Id);
         if (origin != null)
         {
             ObjectUtil.CopyTo(origin, obj);
         }
     }
 }
Ejemplo n.º 2
0
        public ClubActivityRegisterViewModel()
        {
            StartDate = DateTime.Today;
            EndDate   = DateTime.Today;

            using (var ctx = new YakinikuClubDbContext())
            {
                var reposShop      = new ShopRepository(ctx);
                var shops          = reposShop.GetAll().ToList();
                var shopViewModels = new List <ShopViewModel>();
                for (int i = 0; i < shops.Count; i++)
                {
                    shopViewModels.Add(new ShopViewModel());
                }
                ObjectUtil.CopyTo(shops, shopViewModels);
                Shops = shopViewModels;
            }
        }