コード例 #1
0
 public void GetService(int id)
 {
     using (var bc = new BusinessContext(new DbMode()))
     {
         bc.Get <Service, int>(id);
     }
 }
コード例 #2
0
 public void GetUser(int id)
 {
     using (var bc = new BusinessContext(new DbMode()))
     {
         bc.Get <User, int>(id);
     }
 }
コード例 #3
0
 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);
     }
 }
コード例 #4
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);
     }
 }
コード例 #5
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);
     }
 }