public HttpResponseMessage AddUserType(ApiModels.MstUserTypeModel objUserType) { try { Data.MstUserType newUserType = new Data.MstUserType { UserType = objUserType.UserType }; db.MstUserType.InsertOnSubmit(newUserType); db.SubmitChanges(); return(Request.CreateResponse(HttpStatusCode.OK)); } catch (Exception ex) { return(Request.CreateResponse(HttpStatusCode.InternalServerError, ex.Message)); } }
public HttpResponseMessage AddUserType(Entities.MstUserType objUserType) { try { Data.MstUserType newUserType = new Data.MstUserType { UserType = objUserType.UserType }; db.MstUserTypes.InsertOnSubmit(newUserType); db.SubmitChanges(); return(Request.CreateResponse(HttpStatusCode.OK)); } catch (Exception e) { Debug.WriteLine(e); return(Request.CreateResponse(HttpStatusCode.InternalServerError)); } }