public Domain.Entities.Type Update(Domain.Entities.Type t) { try { var res = _typesRepo.Update(t); return(res); } catch (Exception e) { throw e; } }
public Domain.Entities.Type Update([FromBody] Domain.Entities.Type p) { try { Domain.Entities.Type res = _TypesService.Update(p); return(res); } catch (Exception ex) { _logger.LogError(ex.Message); throw ex; } }
public Domain.Entities.Type Find(int TypeID) { try { Domain.Entities.Type p = _TypesService.Get(TypeID); return(p); } catch (Exception ex) { _logger.LogError(ex.Message); throw ex; } }
public int Create(Domain.Entities.Type p) { try { Dictionary <string, object> param = new Dictionary <string, object>(); param.Add("@TypeName", p.TypeName); int res = conn.Execute("insert into Types(TypeName) values(@TypeName)", param); return(res); } catch (Exception ex) { throw ex; } }
public Domain.Entities.Type Update(Domain.Entities.Type p) { try { Dictionary <string, object> param = new Dictionary <string, object>(); param.Add("@TypeID", p.TypeID); param.Add("@TypeName", p.TypeName); int res = conn.Execute("update Types set TypeName = @TypeName where TypeID = @TypeID", param); if (res != 0) { return(this.Get(p.TypeID)); } else { return(null); } } catch (Exception ex) { throw ex; } }