MongoServices 0.2.0
A Service/Repository Framework for mongoDB
C:/Development/MongoServices/Source/MongoServices/Repositories/Classes/ReadOnlyRepository.cs
Go to the documentation of this file.
00001 using System;
00002 using System.Collections.Generic;
00003 using System.Linq;
00004 using System.Text;
00005 using MongoDB.Bson;
00006 
00007 namespace MongoServices
00008 {
00013         public abstract class ReadOnlyRepository<T> : MongoServicesRepository<T>, IReadOnlyRepository<T>
00014                 where T : MongoServicesModel
00015         {
00016                 #region Public Methods
00017 
00018 
00019 
00020 
00021                 public IEnumerable<T> GetAll()
00022                 {
00023                         return Collection.FindAllAs<T>();
00024                 }
00025 
00031                 public T GetById(ObjectId id)
00032                 {
00033                         return Collection.FindOneByIdAs<T>(id);
00034                 }
00035                 #endregion
00036         }
00037 }
 All Classes Namespaces Files Functions Enumerations Properties