public void GetService(int id) { using (var bc = new BusinessContext(new DbMode())) { bc.Get <Service, int>(id); } }
public void GetUser(int id) { using (var bc = new BusinessContext(new DbMode())) { bc.Get <User, int>(id); } }
public void Sevice_GetEntity_Test() { using (var bc = new BusinessContext(new TestMode())) { var resultObject = bc.Add(new Service { NameService = "AO-service-report" }); var result = bc.Get <Service, int>(resultObject.Id); Assert.IsNotNull(result); Assert.IsTrue(result.Id > 0); } }
public void User_GetEntity_Test() { using (var bc = new BusinessContext(new TestMode())) { var resultObject = bc.Add(new User { Username = "******", Password = "******" }); var result = bc.Get <User, int>(resultObject.Id); Assert.IsNotNull(result); Assert.IsTrue(result.Id > 0); } }
public void User_GetEntity_Test() { using (var bc = new BusinessContext(new TestMode())) { var client = new AccountServiceClient(); var resultUser = client.CreateUser(new User() { Username = "******", Password = "******" }); var config = bc.Add(new Config() { Key = "key", Value = "value", UserId = resultUser.Id }); var result = bc.Get <Config, int>(config.Id); Assert.IsNotNull(result); Assert.IsTrue(result.Id > 0); } }