Beispiel #1
0
        public int Update(SponsorItem model)
        {
            Mapper.CreateMap <SponsorItem, SponsorMaster>();
            SponsorMaster objAppoint = DbContext.SponsorMasters.SingleOrDefault(m => m.SID == model.SID);

            objAppoint = Mapper.Map(model, objAppoint);
            return(DbContext.SaveChanges());
        }
Beispiel #2
0
        public SponsorItem GetById(int id)
        {
            Mapper.CreateMap <SponsorMaster, SponsorItem>();
            SponsorMaster objAppoint     = DbContext.SponsorMasters.SingleOrDefault(m => m.SID == id);
            SponsorItem   objAppointItem = Mapper.Map <SponsorItem>(objAppoint);

            return(objAppointItem);
        }
Beispiel #3
0
 public int Insert(SponsorItem model)
 {
     try
     {
         Mapper.CreateMap <SponsorItem, SponsorMaster>();
         SponsorMaster objAppoint = Mapper.Map <SponsorMaster>(model);
         DbContext.SponsorMasters.Add(objAppoint);
         return(DbContext.SaveChanges());
     }
     catch (Exception ex)
     {
         throw;
     }
 }