Beispiel #1
0
        public void Should_Be_Get_by_Id_And_Return_A_Null()
        {
            var serverIdFake = Guid.NewGuid();
            var serverQuery  = _items.AsQueryable().FirstOrDefault(ServerQueries.GetById(serverIdFake));

            Assert.True(serverQuery == null);
        }
Beispiel #2
0
        public void Should_Be_Get_by_Id_And_Return_A_Data()
        {
            var serverIdExcept = _items.FirstOrDefault().Id;
            var serverQuery    = _items.AsQueryable().FirstOrDefault(ServerQueries.GetById(serverIdExcept));

            Assert.Equal(serverIdExcept, serverQuery.Id);
        }
 public Entities.Server GetById(Guid Id)
 {
     return(_dataContext.Servers.AsNoTracking().FirstOrDefault(ServerQueries.GetById(Id)));
 }
 public Entities.Server GetById(Guid id)
 {
     return(_dataContext.Servers.AsQueryable().FirstOrDefault(ServerQueries.GetById(id)));
 }