Example #1
0
 public static User MapUserFromRegisterModel(RegisterModel rm, SocialConnectorDbContext context)
 {
     return(new User
     {
         Email = rm.Email,
         Password = rm.Password,
         UserName = rm.UserName,
         FirstName = rm.FirstName,
         LastName = rm.LastName,
         Nationality = context.Nationalities.FirstOrDefault(n => n.Title == rm.Nationality),
         Religion = context.Religions.FirstOrDefault(r => r.Title == rm.Religion),
         PlaceOfBirth = rm.PlaceOfBirth,
         DateOfBirth = rm.DateOfBirth,
         DateStarted = DateTime.Today,
         Gender = context.Genders.FirstOrDefault(g => g.Title == rm.Gender.ToString())
     });
 }
Example #2
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, SocialConnectorDbContext context)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
                app.UseBrowserLink();
            }
            app.UseStaticFiles();

            app.UseAuthentication();

            app.UseMvc(routes =>
            {
                routes.MapRoute("profile", "profile/{id?}", defaults: new { controller = "Home", action = "Profile" });
                routes.MapRoute("default", "{controller=Home}/{action=Profile}/{id?}");
            });
        }
Example #3
0
 public BaseService(SocialConnectorDbContext context)
 {
     this.context = context;
 }
 public SearchService(SocialConnectorDbContext context) : base(context)
 {
 }
Example #5
0
 public AuthenticationService(SocialConnectorDbContext context, IHttpContextAccessor accessor) : base(context)
 {
     _httpContext = accessor.HttpContext;
 }
 public PredefinedDataService(SocialConnectorDbContext context) : base(context)
 {
 }
Example #7
0
 public UserProfileService(SocialConnectorDbContext context, IHostingEnvironment appEnvironment) : base(context)
 {
     _appEnvironment = appEnvironment;
 }