/// <summary> /// Constructor /// </summary> protected APIMappingBaseClass(params int[] Versions) { ObjectType = typeof(ClassType); Name = ObjectType.Name; Properties = new List <IAPIProperty>(); SetCanDelete(x => true); SetCanGet(x => true); SetCanSave(x => true); SetAll(() => QueryProvider.All <ClassType>()); SetAny(x => QueryProvider.Any <ClassType, IDType>(x.To(default(IDType)))); SetDelete(x => { QueryProvider.Delete(x); return(true); }); SetSave(x => { QueryProvider.Save <ClassType, IDType>(x); return(true); }); SetPaged((x, y, z) => QueryProvider.Paged <ClassType>(x, y, z)); SetPageCount(x => QueryProvider.PageCount <ClassType>(x)); this.Versions = Versions.Check(x => x.Length > 0, new int[] { 1 }).ToList(); }