public static Contracts.Client.IControllerAccess <I> Create <I>() where I : Contracts.IIdentifiable
 {
     Contracts.Client.IControllerAccess <I> result = null;
     if (typeof(I) == typeof(QuickNSmart.Contracts.Persistence.Account.ILoginSession))
     {
         result = new Controllers.Persistence.Account.LoginSessionController(CreateContext()) as Contracts.Client.IControllerAccess <I>;
     }
     else if (typeof(I) == typeof(QuickNSmart.Contracts.Persistence.Account.IRole))
     {
         result = new Controllers.Persistence.Account.RoleController(CreateContext()) as Contracts.Client.IControllerAccess <I>;
     }
     else if (typeof(I) == typeof(QuickNSmart.Contracts.Persistence.Account.IUser))
     {
         result = new Controllers.Persistence.Account.UserController(CreateContext()) as Contracts.Client.IControllerAccess <I>;
     }
     else if (typeof(I) == typeof(QuickNSmart.Contracts.Persistence.Account.IUserXRole))
     {
         result = new Controllers.Persistence.Account.UserXRoleController(CreateContext()) as Contracts.Client.IControllerAccess <I>;
     }
     else if (typeof(I) == typeof(QuickNSmart.Contracts.Business.Account.ILoginUser))
     {
         result = new Controllers.Business.Account.LoginUserController(CreateContext()) as Contracts.Client.IControllerAccess <I>;
     }
     return(result);
 }
Esempio n. 2
0
 public static Contracts.Client.IControllerAccess <I> Create <I>(string sessionToken) where I : Contracts.IIdentifiable
 {
     Contracts.Client.IControllerAccess <I> result = null;
     if (typeof(I) == typeof(QnSContactManager.Contracts.Persistence.App.IContact))
     {
         result = new Controllers.Persistence.App.ContactController(CreateContext())
         {
             SessionToken = sessionToken
         }
         as Contracts.Client.IControllerAccess <I>;
     }
     else if (typeof(I) == typeof(QnSContactManager.Contracts.Persistence.Account.IRole))
     {
         result = new Controllers.Persistence.Account.RoleController(CreateContext())
         {
             SessionToken = sessionToken
         }
         as Contracts.Client.IControllerAccess <I>;
     }
     else if (typeof(I) == typeof(QnSContactManager.Contracts.Business.Account.IAppAccess))
     {
         result = new Controllers.Business.Account.AppAccessController(CreateContext())
         {
             SessionToken = sessionToken
         }
         as Contracts.Client.IControllerAccess <I>;
     }
     return(result);
 }
Esempio n. 3
0
 public static Contracts.Client.IControllerAccess <I> Create <I>() where I : Contracts.IIdentifiable
 {
     Contracts.Client.IControllerAccess <I> result = null;
     if (typeof(I) == typeof(QuickNSmart.Contracts.Persistence.TestOneToMany.IInvoice))
     {
         result = new Controllers.Persistence.TestOneToMany.InvoiceController(CreateContext()) as Contracts.Client.IControllerAccess <I>;
     }
     else if (typeof(I) == typeof(QuickNSmart.Contracts.Persistence.TestOneToMany.IInvoiceDetail))
     {
         result = new Controllers.Persistence.TestOneToMany.InvoiceDetailController(CreateContext()) as Contracts.Client.IControllerAccess <I>;
     }
     else if (typeof(I) == typeof(QuickNSmart.Contracts.Persistence.Account.IRole))
     {
         result = new Controllers.Persistence.Account.RoleController(CreateContext()) as Contracts.Client.IControllerAccess <I>;
     }
     else if (typeof(I) == typeof(QuickNSmart.Contracts.Persistence.Account.IUser))
     {
         result = new Controllers.Persistence.Account.UserController(CreateContext()) as Contracts.Client.IControllerAccess <I>;
     }
     else if (typeof(I) == typeof(QuickNSmart.Contracts.Business.TestOneToMany.IInvoiceDetails))
     {
         result = new Controllers.Business.TestOneToMany.InvoiceDetailsController(CreateContext()) as Contracts.Client.IControllerAccess <I>;
     }
     else if (typeof(I) == typeof(QuickNSmart.Contracts.Business.Account.IAppAccess))
     {
         result = new Controllers.Business.Account.AppAccessController(CreateContext()) as Contracts.Client.IControllerAccess <I>;
     }
     else if (typeof(I) == typeof(QuickNSmart.Contracts.Business.Account.IIdentityUser))
     {
         result = new Controllers.Business.Account.IdentityUserController(CreateContext()) as Contracts.Client.IControllerAccess <I>;
     }
     return(result);
 }
Esempio n. 4
0
 public static Contracts.Client.IControllerAccess <I> Create <I>(object sharedController) where I : Contracts.IIdentifiable
 {
     Contracts.Client.IControllerAccess <I> result = null;
     if (typeof(I) == typeof(QnSContactManager.Contracts.Persistence.App.IContact))
     {
         result = new Controllers.Persistence.App.ContactController(sharedController as Controllers.ControllerObject) as Contracts.Client.IControllerAccess <I>;
     }
     else if (typeof(I) == typeof(QnSContactManager.Contracts.Persistence.Account.IRole))
     {
         result = new Controllers.Persistence.Account.RoleController(sharedController as Controllers.ControllerObject) as Contracts.Client.IControllerAccess <I>;
     }
     else if (typeof(I) == typeof(QnSContactManager.Contracts.Business.Account.IAppAccess))
     {
         result = new Controllers.Business.Account.AppAccessController(sharedController as Controllers.ControllerObject) as Contracts.Client.IControllerAccess <I>;
     }
     return(result);
 }
 public static Contracts.Client.IControllerAccess <I> Create <I>() where I : Contracts.IIdentifiable
 {
     Contracts.Client.IControllerAccess <I> result = null;
     if (typeof(I) == typeof(QnSHolidayCalendar.Contracts.Persistence.App.ICalendarEntry))
     {
         result = new Controllers.Persistence.App.CalendarEntryController(CreateContext()) as Contracts.Client.IControllerAccess <I>;
     }
     else if (typeof(I) == typeof(QnSHolidayCalendar.Contracts.Persistence.Account.IRole))
     {
         result = new Controllers.Persistence.Account.RoleController(CreateContext()) as Contracts.Client.IControllerAccess <I>;
     }
     else if (typeof(I) == typeof(QnSHolidayCalendar.Contracts.Business.App.IHolidayEntry))
     {
         result = new Controllers.Business.App.HolidayEntryController(CreateContext()) as Contracts.Client.IControllerAccess <I>;
     }
     else if (typeof(I) == typeof(QnSHolidayCalendar.Contracts.Business.Account.IAppAccess))
     {
         result = new Controllers.Business.Account.AppAccessController(CreateContext()) as Contracts.Client.IControllerAccess <I>;
     }
     return(result);
 }
        internal static async Task <IEnumerable <Role> > QueryIdentityRolesAsync(Controllers.ControllerObject controllerObject, int identityId)
        {
            controllerObject.CheckArgument(nameof(controllerObject));

            List <Role> result = new List <Role>();

            using var identityXRoleCtrl = new Controllers.Persistence.Account.IdentityXRoleController(controllerObject);
            using var roleCtrl          = new Controllers.Persistence.Account.RoleController(controllerObject);

            foreach (var item in identityXRoleCtrl.ExecuteQuery(e => e.IdentityId == identityId).ToList())
            {
                var entity = await roleCtrl.ExecuteGetByIdAsync(item.RoleId).ConfigureAwait(false);

                if (entity != null)
                {
                    var role = new Role();

                    role.CopyProperties(entity);
                    result.Add(role);
                }
            }
            return(result);
        }
Esempio n. 7
0
 public static Contracts.Client.IControllerAccess <I> Create <I>(object sharedController) where I : Contracts.IIdentifiable
 {
     Contracts.Client.IControllerAccess <I> result = null;
     if (typeof(I) == typeof(QnSBillShare.Contracts.Persistence.App.IBill))
     {
         result = new Controllers.Persistence.App.BillController(sharedController as Controllers.ControllerObject) as Contracts.Client.IControllerAccess <I>;
     }
     else if (typeof(I) == typeof(QnSBillShare.Contracts.Persistence.App.IExpense))
     {
         result = new Controllers.Persistence.App.ExpenseController(sharedController as Controllers.ControllerObject) as Contracts.Client.IControllerAccess <I>;
     }
     else if (typeof(I) == typeof(QnSBillShare.Contracts.Persistence.Account.ILoginSession))
     {
         result = new Controllers.Persistence.Account.LoginSessionController(sharedController as Controllers.ControllerObject) as Contracts.Client.IControllerAccess <I>;
     }
     else if (typeof(I) == typeof(QnSBillShare.Contracts.Persistence.Account.IRole))
     {
         result = new Controllers.Persistence.Account.RoleController(sharedController as Controllers.ControllerObject) as Contracts.Client.IControllerAccess <I>;
     }
     else if (typeof(I) == typeof(QnSBillShare.Contracts.Persistence.Account.IUser))
     {
         result = new Controllers.Persistence.Account.UserController(sharedController as Controllers.ControllerObject) as Contracts.Client.IControllerAccess <I>;
     }
     else if (typeof(I) == typeof(QnSBillShare.Contracts.Persistence.Account.IUserXRole))
     {
         result = new Controllers.Persistence.Account.UserXRoleController(sharedController as Controllers.ControllerObject) as Contracts.Client.IControllerAccess <I>;
     }
     else if (typeof(I) == typeof(QnSBillShare.Contracts.Business.App.IBillExpenses))
     {
         result = new Controllers.Business.App.BillExpensesController(sharedController as Controllers.ControllerObject) as Contracts.Client.IControllerAccess <I>;
     }
     else if (typeof(I) == typeof(QnSBillShare.Contracts.Business.Account.ILoginUser))
     {
         result = new Controllers.Business.Account.LoginUserController(sharedController as Controllers.ControllerObject) as Contracts.Client.IControllerAccess <I>;
     }
     return(result);
 }
Esempio n. 8
0
 public static Contracts.Client.IControllerAccess <I> Create <I>(object sharedController) where I : Contracts.IIdentifiable
 {
     Contracts.Client.IControllerAccess <I> result;
     if (typeof(I) == typeof(QnSProjectAward.Contracts.Persistence.Language.ITranslation))
     {
         result = new Controllers.Persistence.Language.TranslationController(sharedController as Controllers.ControllerObject) as Contracts.Client.IControllerAccess <I>;
     }
     else if (typeof(I) == typeof(QnSProjectAward.Contracts.Persistence.Data.IBinaryData))
     {
         result = new Controllers.Persistence.Data.BinaryDataController(sharedController as Controllers.ControllerObject) as Contracts.Client.IControllerAccess <I>;
     }
     else if (typeof(I) == typeof(QnSProjectAward.Contracts.Persistence.Configuration.IIdentitySetting))
     {
         result = new Controllers.Persistence.Configuration.IdentitySettingController(sharedController as Controllers.ControllerObject) as Contracts.Client.IControllerAccess <I>;
     }
     else if (typeof(I) == typeof(QnSProjectAward.Contracts.Persistence.Configuration.ISetting))
     {
         result = new Controllers.Persistence.Configuration.SettingController(sharedController as Controllers.ControllerObject) as Contracts.Client.IControllerAccess <I>;
     }
     else if (typeof(I) == typeof(QnSProjectAward.Contracts.Persistence.App.IAward))
     {
         result = new Controllers.Persistence.App.AwardController(sharedController as Controllers.ControllerObject) as Contracts.Client.IControllerAccess <I>;
     }
     else if (typeof(I) == typeof(QnSProjectAward.Contracts.Persistence.App.IJuror))
     {
         result = new Controllers.Persistence.App.JurorController(sharedController as Controllers.ControllerObject) as Contracts.Client.IControllerAccess <I>;
     }
     else if (typeof(I) == typeof(QnSProjectAward.Contracts.Persistence.App.IMember))
     {
         result = new Controllers.Persistence.App.MemberController(sharedController as Controllers.ControllerObject) as Contracts.Client.IControllerAccess <I>;
     }
     else if (typeof(I) == typeof(QnSProjectAward.Contracts.Persistence.App.IProject))
     {
         result = new Controllers.Persistence.App.ProjectController(sharedController as Controllers.ControllerObject) as Contracts.Client.IControllerAccess <I>;
     }
     else if (typeof(I) == typeof(QnSProjectAward.Contracts.Persistence.App.IRating))
     {
         result = new Controllers.Persistence.App.RatingController(sharedController as Controllers.ControllerObject) as Contracts.Client.IControllerAccess <I>;
     }
     else if (typeof(I) == typeof(QnSProjectAward.Contracts.Persistence.Account.IAccess))
     {
         result = new Controllers.Persistence.Account.AccessController(sharedController as Controllers.ControllerObject) as Contracts.Client.IControllerAccess <I>;
     }
     else if (typeof(I) == typeof(QnSProjectAward.Contracts.Persistence.Account.IActionLog))
     {
         result = new Controllers.Persistence.Account.ActionLogController(sharedController as Controllers.ControllerObject) as Contracts.Client.IControllerAccess <I>;
     }
     else if (typeof(I) == typeof(QnSProjectAward.Contracts.Persistence.Account.IIdentity))
     {
         result = new Controllers.Persistence.Account.IdentityController(sharedController as Controllers.ControllerObject) as Contracts.Client.IControllerAccess <I>;
     }
     else if (typeof(I) == typeof(QnSProjectAward.Contracts.Persistence.Account.IIdentityXRole))
     {
         result = new Controllers.Persistence.Account.IdentityXRoleController(sharedController as Controllers.ControllerObject) as Contracts.Client.IControllerAccess <I>;
     }
     else if (typeof(I) == typeof(QnSProjectAward.Contracts.Persistence.Account.ILoginSession))
     {
         result = new Controllers.Persistence.Account.LoginSessionController(sharedController as Controllers.ControllerObject) as Contracts.Client.IControllerAccess <I>;
     }
     else if (typeof(I) == typeof(QnSProjectAward.Contracts.Persistence.Account.IRole))
     {
         result = new Controllers.Persistence.Account.RoleController(sharedController as Controllers.ControllerObject) as Contracts.Client.IControllerAccess <I>;
     }
     else if (typeof(I) == typeof(QnSProjectAward.Contracts.Persistence.Account.IUser))
     {
         result = new Controllers.Persistence.Account.UserController(sharedController as Controllers.ControllerObject) as Contracts.Client.IControllerAccess <I>;
     }
     else if (typeof(I) == typeof(QnSProjectAward.Contracts.Business.Account.IAppAccess))
     {
         result = new Controllers.Business.Account.AppAccessController(sharedController as Controllers.ControllerObject) as Contracts.Client.IControllerAccess <I>;
     }
     else if (typeof(I) == typeof(QnSProjectAward.Contracts.Business.Account.IIdentityUser))
     {
         result = new Controllers.Business.Account.IdentityUserController(sharedController as Controllers.ControllerObject) as Contracts.Client.IControllerAccess <I>;
     }
     else
     {
         throw new Logic.Modules.Exception.LogicException(Modules.Exception.ErrorType.InvalidControllerType);
     }
     return(result);
 }