public DataLib.Models.ApplicationModel Register([FromBody] Models.RegisterRequest request) { var repo = new DataLib.Repository(); var app = new DataLib.Models.ApplicationModel() { Display_Name = request.Display_Name, Application_Id = Guid.NewGuid().ToString().Replace("-", ""), }; app.Secret = app.Application_Id.Substring(0, 25); repo.InsertApplication(app); return(app); }
public DataLib.Models.ApplicationModel InsertApplication() { DataLib.Repository repo = new DataLib.Repository(); var model = new DataLib.Models.ApplicationModel() { Application_Id = Guid.NewGuid().ToString().Replace("-", ""), Display_Name = "UnitTest", Secret = "test" }; repo.InsertApplication(model); var app = repo.GetApplication(model.Application_Id); return(app); }