public bool Update(ApartmentFile entity)
 {
     try
     {
         context.Update(entity);
         context.SaveChanges();
     }
     catch (Exception)
     {
         return(false);
     }
     return(true);
 }
 public bool Save(ApartmentFile entity)
 {
     try
     {
         context.ApartmentFiles.Add(entity);
         context.SaveChanges();
     }
     catch (System.Exception)
     {
         return(false);
     }
     return(true);
 }
        public ApartmentFile Get(int id)
        {
            var result = new ApartmentFile();

            try
            {
                result = context.ApartmentFiles.Single(x => x.Id == id);
            }
            catch (Exception)
            {
                throw;
            }
            return(result);
        }
Beispiel #4
0
 public bool Update(ApartmentFile entity)
 {
     return(apartmentFileRepository.Update(entity));
 }
Beispiel #5
0
 public bool Save(ApartmentFile entity)
 {
     return(apartmentFileRepository.Save(entity));
 }
 public ActionResult Put([FromBody] ApartmentFile apartmentFile)
 {
     return(Ok(apartmentFileService.Update(apartmentFile)));
 }
 public ActionResult Post([FromBody] ApartmentFile apartmentFile)
 {
     return(Ok(apartmentFileService.Save(apartmentFile)));
 }