diff --git a/AspNet4/Mvc/AdhocReporting/App_Start/BundleConfig.cs b/AspNet4/Mvc/AdhocReporting/App_Start/BundleConfig.cs deleted file mode 100644 index 4ab56283..00000000 --- a/AspNet4/Mvc/AdhocReporting/App_Start/BundleConfig.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Web; -using System.Web.Optimization; - -namespace EqDemo -{ - public class BundleConfig - { - // For more information on bundling, visit https://go.microsoft.com/fwlink/?LinkId=301862 - public static void RegisterBundles(BundleCollection bundles) - { - } - } -} diff --git a/AspNet4/Mvc/AdhocReporting/App_Start/FilterConfig.cs b/AspNet4/Mvc/AdhocReporting/App_Start/FilterConfig.cs deleted file mode 100644 index 4dc97cb5..00000000 --- a/AspNet4/Mvc/AdhocReporting/App_Start/FilterConfig.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Web; -using System.Web.Mvc; - -namespace EqDemo -{ - public class FilterConfig - { - public static void RegisterGlobalFilters(GlobalFilterCollection filters) - { - filters.Add(new HandleErrorAttribute()); - } - } -} diff --git a/AspNet4/Mvc/AdhocReporting/App_Start/IdentityConfig.cs b/AspNet4/Mvc/AdhocReporting/App_Start/IdentityConfig.cs deleted file mode 100644 index 13e3f6a2..00000000 --- a/AspNet4/Mvc/AdhocReporting/App_Start/IdentityConfig.cs +++ /dev/null @@ -1,109 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Data.Entity; -using System.Linq; -using System.Security.Claims; -using System.Threading.Tasks; -using System.Web; -using Microsoft.AspNet.Identity; -using Microsoft.AspNet.Identity.EntityFramework; -using Microsoft.AspNet.Identity.Owin; -using Microsoft.Owin; -using Microsoft.Owin.Security; -using EqDemo.Models; - -namespace EqDemo -{ - public class EmailService : IIdentityMessageService - { - public Task SendAsync(IdentityMessage message) - { - // Plug in your email service here to send an email. - return Task.FromResult(0); - } - } - - public class SmsService : IIdentityMessageService - { - public Task SendAsync(IdentityMessage message) - { - // Plug in your SMS service here to send a text message. - return Task.FromResult(0); - } - } - - // Configure the application user manager used in this application. UserManager is defined in ASP.NET Identity and is used by the application. - public class ApplicationUserManager : UserManager - { - public ApplicationUserManager(IUserStore store) - : base(store) - { - } - - public static ApplicationUserManager Create(IdentityFactoryOptions options, IOwinContext context) - { - var manager = new ApplicationUserManager(new UserStore(context.Get())); - // Configure validation logic for usernames - manager.UserValidator = new UserValidator(manager) - { - AllowOnlyAlphanumericUserNames = false, - RequireUniqueEmail = true - }; - - // Configure validation logic for passwords - manager.PasswordValidator = new PasswordValidator - { - RequiredLength = 4, - RequireNonLetterOrDigit = false, - RequireDigit = false, - RequireLowercase = false, - RequireUppercase = false, - }; - - // Configure user lockout defaults - manager.UserLockoutEnabledByDefault = true; - manager.DefaultAccountLockoutTimeSpan = TimeSpan.FromMinutes(5); - manager.MaxFailedAccessAttemptsBeforeLockout = 5; - - // Register two factor authentication providers. This application uses Phone and Emails as a step of receiving a code for verifying the user - // You can write your own provider and plug it in here. - manager.RegisterTwoFactorProvider("Phone Code", new PhoneNumberTokenProvider - { - MessageFormat = "Your security code is {0}" - }); - manager.RegisterTwoFactorProvider("Email Code", new EmailTokenProvider - { - Subject = "Security Code", - BodyFormat = "Your security code is {0}" - }); - manager.EmailService = new EmailService(); - manager.SmsService = new SmsService(); - var dataProtectionProvider = options.DataProtectionProvider; - if (dataProtectionProvider != null) - { - manager.UserTokenProvider = - new DataProtectorTokenProvider(dataProtectionProvider.Create("ASP.NET Identity")); - } - return manager; - } - } - - // Configure the application sign-in manager which is used in this application. - public class ApplicationSignInManager : SignInManager - { - public ApplicationSignInManager(ApplicationUserManager userManager, IAuthenticationManager authenticationManager) - : base(userManager, authenticationManager) - { - } - - public override Task CreateUserIdentityAsync(ApplicationUser user) - { - return user.GenerateUserIdentityAsync((ApplicationUserManager)UserManager); - } - - public static ApplicationSignInManager Create(IdentityFactoryOptions options, IOwinContext context) - { - return new ApplicationSignInManager(context.GetUserManager(), context.Authentication); - } - } -} diff --git a/AspNet4/Mvc/AdhocReporting/App_Start/RouteConfig.cs b/AspNet4/Mvc/AdhocReporting/App_Start/RouteConfig.cs deleted file mode 100644 index a6ba8187..00000000 --- a/AspNet4/Mvc/AdhocReporting/App_Start/RouteConfig.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web; -using System.Web.Mvc; -using System.Web.Routing; - -namespace EqDemo -{ - public class RouteConfig - { - public static void RegisterRoutes(RouteCollection routes) - { - routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); - - routes.MapMvcAttributeRoutes(); - - routes.MapRoute( - name: "Default", - url: "{controller}/{action}/{id}", - defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional } - ); - } - } -} diff --git a/AspNet4/Mvc/AdhocReporting/App_Start/Startup.Auth.cs b/AspNet4/Mvc/AdhocReporting/App_Start/Startup.Auth.cs deleted file mode 100644 index 391f3392..00000000 --- a/AspNet4/Mvc/AdhocReporting/App_Start/Startup.Auth.cs +++ /dev/null @@ -1,84 +0,0 @@ -using System; -using System.Web; -using Microsoft.AspNet.Identity; -using Microsoft.AspNet.Identity.Owin; -using Microsoft.Owin; -using Microsoft.Owin.Security.Cookies; -using Microsoft.Owin.Security.Google; -using Owin; -using EqDemo.Models; - -namespace EqDemo -{ - public partial class Startup - { - // For more information on configuring authentication, please visit https://go.microsoft.com/fwlink/?LinkId=301864 - public void ConfigureAuth(IAppBuilder app) - { - // Configure the db context, user manager and signin manager to use a single instance per request - app.CreatePerOwinContext(ApplicationDbContext.Create); - app.CreatePerOwinContext(ApplicationUserManager.Create); - app.CreatePerOwinContext(ApplicationSignInManager.Create); - - // Enable the application to use a cookie to store information for the signed in user - // and to use a cookie to temporarily store information about a user logging in with a third party login provider - // Configure the sign in cookie - app.UseCookieAuthentication(new CookieAuthenticationOptions - { - AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie, - LoginPath = new PathString("/Account/Login"), - Provider = new CookieAuthenticationProvider - { - // Enables the application to validate the security stamp when the user logs in. - // This is a security feature which is used when you change a password or add an external login to your account. - OnValidateIdentity = SecurityStampValidator.OnValidateIdentity( - validateInterval: TimeSpan.FromMinutes(30), - regenerateIdentity: (manager, user) => user.GenerateUserIdentityAsync(manager)), - - // This code is needed to forbid reditrect for api methods - // when user is unauthorized - OnApplyRedirect = ctx => { - - if (!IsApiRequest(ctx.Request)) { - ctx.Response.Redirect(ctx.RedirectUri); - } - } - } - }); - app.UseExternalSignInCookie(DefaultAuthenticationTypes.ExternalCookie); - - // Enables the application to temporarily store user information when they are verifying the second factor in the two-factor authentication process. - app.UseTwoFactorSignInCookie(DefaultAuthenticationTypes.TwoFactorCookie, TimeSpan.FromMinutes(5)); - - // Enables the application to remember the second login verification factor such as phone or email. - // Once you check this option, your second step of verification during the login process will be remembered on the device where you logged in from. - // This is similar to the RememberMe option when you log in. - app.UseTwoFactorRememberBrowserCookie(DefaultAuthenticationTypes.TwoFactorRememberBrowserCookie); - - // Uncomment the following lines to enable logging in with third party login providers - //app.UseMicrosoftAccountAuthentication( - // clientId: "", - // clientSecret: ""); - - //app.UseTwitterAuthentication( - // consumerKey: "", - // consumerSecret: ""); - - //app.UseFacebookAuthentication( - // appId: "", - // appSecret: ""); - - //app.UseGoogleAuthentication(new GoogleOAuth2AuthenticationOptions() - //{ - // ClientId = "", - // ClientSecret = "" - //}); - } - - private static bool IsApiRequest(IOwinRequest request) - { - string apiPath = VirtualPathUtility.ToAbsolute("~/api/"); - return request.Uri.LocalPath.StartsWith(apiPath); - } - } -} \ No newline at end of file diff --git a/AspNet4/Mvc/AdhocReporting/App_Start/WebApiConfig.cs b/AspNet4/Mvc/AdhocReporting/App_Start/WebApiConfig.cs deleted file mode 100644 index 29b2c221..00000000 --- a/AspNet4/Mvc/AdhocReporting/App_Start/WebApiConfig.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Web.Http; -using System.Web.Http.Controllers; -using System.Web.Http.Routing; -using Korzh.EasyQuery.Services; - -using EasyData.Export; - -using Korzh.EasyQuery.AspNet; - -namespace EqDemo -{ - public static class WebApiConfig - { - public static void Register(HttpConfiguration config) - { - // Web API configuration and services - - // Web API routes - config.MapHttpAttributeRoutesWithEasyQuery(); - - config.Routes.MapHttpRoute( - name: "DefaultApi", - routeTemplate: "api/{controller}/{id}", - defaults: new { id = RouteParameter.Optional } - ); - - // Register you exportes here - // to make export works - EasyQueryManager.RegisterExporter("csv", new CsvDataExporter()); - EasyQueryManager.RegisterExporter("excel", new ExcelDataExporter()); - EasyQueryManager.RegisterExporter("excel-html", new ExcelHtmlDataExporter()); - EasyQueryManager.RegisterExporter("pdf", new PdfDataExporter()); - - // Uncomment this line to enable model loading from DbConnection - // EasyQueryManagerSql.RegisterDbGate(); - } - } -} diff --git a/AspNet4/Mvc/AdhocReporting/Controllers/AccountController.cs b/AspNet4/Mvc/AdhocReporting/Controllers/AccountController.cs deleted file mode 100644 index 7773d4d2..00000000 --- a/AspNet4/Mvc/AdhocReporting/Controllers/AccountController.cs +++ /dev/null @@ -1,497 +0,0 @@ -using System; -using System.Globalization; -using System.Linq; -using System.Security.Claims; -using System.Threading.Tasks; -using System.Web; -using System.Web.Mvc; -using Microsoft.AspNet.Identity; -using Microsoft.AspNet.Identity.Owin; -using Microsoft.Owin.Security; - -using EqDemo.Models; -using EqDemo.Services; - -namespace EqDemo.Controllers -{ - [Authorize] - public class AccountController : Controller - { - private ApplicationSignInManager _signInManager; - private ApplicationUserManager _userManager; - - private DefaultReportGenerator _reportGenerator; - - public AccountController() - { - _reportGenerator = new DefaultReportGenerator(ApplicationDbContext.Create()); - } - - public AccountController(ApplicationUserManager userManager, ApplicationSignInManager signInManager): this() - { - UserManager = userManager; - SignInManager = signInManager; - } - - public ApplicationSignInManager SignInManager - { - get - { - return _signInManager ?? HttpContext.GetOwinContext().Get(); - } - private set - { - _signInManager = value; - } - } - - public ApplicationUserManager UserManager - { - get - { - return _userManager ?? HttpContext.GetOwinContext().GetUserManager(); - } - private set - { - _userManager = value; - } - } - - // - // GET: /Account/Login - [AllowAnonymous] - public ActionResult Login(string returnUrl) - { - ViewBag.ReturnUrl = returnUrl; - return View(); - } - - // - // POST: /Account/Login - [HttpPost] - [AllowAnonymous] - [ValidateAntiForgeryToken] - public async Task Login(LoginViewModel model, string returnUrl) - { - if (!ModelState.IsValid) - { - return View(model); - } - - // This doesn't count login failures towards account lockout - // To enable password failures to trigger account lockout, change to shouldLockout: true - var result = await SignInManager.PasswordSignInAsync(model.Email, model.Password, model.RememberMe, shouldLockout: false); - switch (result) - { - case SignInStatus.Success: - return RedirectToLocal(returnUrl); - case SignInStatus.LockedOut: - return View("Lockout"); - case SignInStatus.RequiresVerification: - return RedirectToAction("SendCode", new { ReturnUrl = returnUrl, RememberMe = model.RememberMe }); - case SignInStatus.Failure: - default: - ViewBag.ReturnUrl = returnUrl; - ModelState.AddModelError("", "Invalid login attempt."); - return View(model); - } - } - - // - // GET: /Account/VerifyCode - [AllowAnonymous] - public async Task VerifyCode(string provider, string returnUrl, bool rememberMe) - { - // Require that the user has already logged in via username/password or external login - if (!await SignInManager.HasBeenVerifiedAsync()) - { - return View("Error"); - } - return View(new VerifyCodeViewModel { Provider = provider, ReturnUrl = returnUrl, RememberMe = rememberMe }); - } - - // - // POST: /Account/VerifyCode - [HttpPost] - [AllowAnonymous] - [ValidateAntiForgeryToken] - public async Task VerifyCode(VerifyCodeViewModel model) - { - if (!ModelState.IsValid) - { - return View(model); - } - - // The following code protects for brute force attacks against the two factor codes. - // If a user enters incorrect codes for a specified amount of time then the user account - // will be locked out for a specified amount of time. - // You can configure the account lockout settings in IdentityConfig - var result = await SignInManager.TwoFactorSignInAsync(model.Provider, model.Code, isPersistent: model.RememberMe, rememberBrowser: model.RememberBrowser); - switch (result) - { - case SignInStatus.Success: - return RedirectToLocal(model.ReturnUrl); - case SignInStatus.LockedOut: - return View("Lockout"); - case SignInStatus.Failure: - default: - ModelState.AddModelError("", "Invalid code."); - return View(model); - } - } - - // - // GET: /Account/Register - [AllowAnonymous] - public ActionResult Register(string returnUrl) - { - ViewBag.ReturnUrl = returnUrl; - return View(); - } - - // - // POST: /Account/Register - [HttpPost] - [AllowAnonymous] - [ValidateAntiForgeryToken] - public async Task Register(RegisterViewModel model, string returnUrl) - { - if (ModelState.IsValid) - { - var user = new ApplicationUser { UserName = model.Email, Email = model.Email }; - var result = await UserManager.CreateAsync(user, model.Password); - if (result.Succeeded) - { - await UserManager.AddToRoleAsync(user.Id, "eq-manager"); - await SignInManager.SignInAsync(user, isPersistent:false, rememberBrowser:false); - - _reportGenerator.Generate(user); - - // For more information on how to enable account confirmation and password reset please visit https://go.microsoft.com/fwlink/?LinkID=320771 - // Send an email with this link - // string code = await UserManager.GenerateEmailConfirmationTokenAsync(user.Id); - // var callbackUrl = Url.Action("ConfirmEmail", "Account", new { userId = user.Id, code = code }, protocol: Request.Url.Scheme); - // await UserManager.SendEmailAsync(user.Id, "Confirm your account", "Please confirm your account by clicking here"); - - return RedirectToLocal(returnUrl); - } - AddErrors(result); - } - - ViewBag.ReturnUrl = returnUrl; - - // If we got this far, something failed, redisplay form - return View(model); - } - - // - // GET: /Account/ConfirmEmail - [AllowAnonymous] - public async Task ConfirmEmail(string userId, string code) - { - if (userId == null || code == null) - { - return View("Error"); - } - var result = await UserManager.ConfirmEmailAsync(userId, code); - return View(result.Succeeded ? "ConfirmEmail" : "Error"); - } - - // - // GET: /Account/ForgotPassword - [AllowAnonymous] - public ActionResult ForgotPassword() - { - return View(); - } - - // - // POST: /Account/ForgotPassword - [HttpPost] - [AllowAnonymous] - [ValidateAntiForgeryToken] - public async Task ForgotPassword(ForgotPasswordViewModel model) - { - if (ModelState.IsValid) - { - var user = await UserManager.FindByNameAsync(model.Email); - if (user == null || !(await UserManager.IsEmailConfirmedAsync(user.Id))) - { - // Don't reveal that the user does not exist or is not confirmed - return View("ForgotPasswordConfirmation"); - } - - // For more information on how to enable account confirmation and password reset please visit https://go.microsoft.com/fwlink/?LinkID=320771 - // Send an email with this link - // string code = await UserManager.GeneratePasswordResetTokenAsync(user.Id); - // var callbackUrl = Url.Action("ResetPassword", "Account", new { userId = user.Id, code = code }, protocol: Request.Url.Scheme); - // await UserManager.SendEmailAsync(user.Id, "Reset Password", "Please reset your password by clicking here"); - // return RedirectToAction("ForgotPasswordConfirmation", "Account"); - } - - // If we got this far, something failed, redisplay form - return View(model); - } - - // - // GET: /Account/ForgotPasswordConfirmation - [AllowAnonymous] - public ActionResult ForgotPasswordConfirmation() - { - return View(); - } - - // - // GET: /Account/ResetPassword - [AllowAnonymous] - public ActionResult ResetPassword(string code) - { - return code == null ? View("Error") : View(); - } - - // - // POST: /Account/ResetPassword - [HttpPost] - [AllowAnonymous] - [ValidateAntiForgeryToken] - public async Task ResetPassword(ResetPasswordViewModel model) - { - if (!ModelState.IsValid) - { - return View(model); - } - var user = await UserManager.FindByNameAsync(model.Email); - if (user == null) - { - // Don't reveal that the user does not exist - return RedirectToAction("ResetPasswordConfirmation", "Account"); - } - var result = await UserManager.ResetPasswordAsync(user.Id, model.Code, model.Password); - if (result.Succeeded) - { - return RedirectToAction("ResetPasswordConfirmation", "Account"); - } - AddErrors(result); - return View(); - } - - // - // GET: /Account/ResetPasswordConfirmation - [AllowAnonymous] - public ActionResult ResetPasswordConfirmation() - { - return View(); - } - - // - // POST: /Account/ExternalLogin - [HttpPost] - [AllowAnonymous] - [ValidateAntiForgeryToken] - public ActionResult ExternalLogin(string provider, string returnUrl) - { - // Request a redirect to the external login provider - return new ChallengeResult(provider, Url.Action("ExternalLoginCallback", "Account", new { ReturnUrl = returnUrl })); - } - - // - // GET: /Account/SendCode - [AllowAnonymous] - public async Task SendCode(string returnUrl, bool rememberMe) - { - var userId = await SignInManager.GetVerifiedUserIdAsync(); - if (userId == null) - { - return View("Error"); - } - var userFactors = await UserManager.GetValidTwoFactorProvidersAsync(userId); - var factorOptions = userFactors.Select(purpose => new SelectListItem { Text = purpose, Value = purpose }).ToList(); - return View(new SendCodeViewModel { Providers = factorOptions, ReturnUrl = returnUrl, RememberMe = rememberMe }); - } - - // - // POST: /Account/SendCode - [HttpPost] - [AllowAnonymous] - [ValidateAntiForgeryToken] - public async Task SendCode(SendCodeViewModel model) - { - if (!ModelState.IsValid) - { - return View(); - } - - // Generate the token and send it - if (!await SignInManager.SendTwoFactorCodeAsync(model.SelectedProvider)) - { - return View("Error"); - } - return RedirectToAction("VerifyCode", new { Provider = model.SelectedProvider, ReturnUrl = model.ReturnUrl, RememberMe = model.RememberMe }); - } - - // - // GET: /Account/ExternalLoginCallback - [AllowAnonymous] - public async Task ExternalLoginCallback(string returnUrl) - { - var loginInfo = await AuthenticationManager.GetExternalLoginInfoAsync(); - if (loginInfo == null) - { - return RedirectToAction("Login"); - } - - // Sign in the user with this external login provider if the user already has a login - var result = await SignInManager.ExternalSignInAsync(loginInfo, isPersistent: false); - switch (result) - { - case SignInStatus.Success: - return RedirectToLocal(returnUrl); - case SignInStatus.LockedOut: - return View("Lockout"); - case SignInStatus.RequiresVerification: - return RedirectToAction("SendCode", new { ReturnUrl = returnUrl, RememberMe = false }); - case SignInStatus.Failure: - default: - // If the user does not have an account, then prompt the user to create an account - ViewBag.ReturnUrl = returnUrl; - ViewBag.LoginProvider = loginInfo.Login.LoginProvider; - return View("ExternalLoginConfirmation", new ExternalLoginConfirmationViewModel { Email = loginInfo.Email }); - } - } - - // - // POST: /Account/ExternalLoginConfirmation - [HttpPost] - [AllowAnonymous] - [ValidateAntiForgeryToken] - public async Task ExternalLoginConfirmation(ExternalLoginConfirmationViewModel model, string returnUrl) - { - if (User.Identity.IsAuthenticated) - { - return RedirectToAction("Index", "Manage"); - } - - if (ModelState.IsValid) - { - // Get the information about the user from the external login provider - var info = await AuthenticationManager.GetExternalLoginInfoAsync(); - if (info == null) - { - return View("ExternalLoginFailure"); - } - var user = new ApplicationUser { UserName = model.Email, Email = model.Email }; - var result = await UserManager.CreateAsync(user); - if (result.Succeeded) - { - result = await UserManager.AddLoginAsync(user.Id, info.Login); - if (result.Succeeded) - { - await SignInManager.SignInAsync(user, isPersistent: false, rememberBrowser: false); - return RedirectToLocal(returnUrl); - } - } - AddErrors(result); - } - - ViewBag.ReturnUrl = returnUrl; - return View(model); - } - - // - // POST: /Account/LogOff - [HttpPost] - [ValidateAntiForgeryToken] - public ActionResult LogOff() - { - AuthenticationManager.SignOut(DefaultAuthenticationTypes.ApplicationCookie); - return RedirectToAction("Index", "Home"); - } - - // - // GET: /Account/ExternalLoginFailure - [AllowAnonymous] - public ActionResult ExternalLoginFailure() - { - return View(); - } - - protected override void Dispose(bool disposing) - { - if (disposing) - { - if (_userManager != null) - { - _userManager.Dispose(); - _userManager = null; - } - - if (_signInManager != null) - { - _signInManager.Dispose(); - _signInManager = null; - } - } - - base.Dispose(disposing); - } - - #region Helpers - // Used for XSRF protection when adding external logins - private const string XsrfKey = "XsrfId"; - - private IAuthenticationManager AuthenticationManager - { - get - { - return HttpContext.GetOwinContext().Authentication; - } - } - - private void AddErrors(IdentityResult result) - { - foreach (var error in result.Errors) - { - ModelState.AddModelError("", error); - } - } - - private ActionResult RedirectToLocal(string returnUrl) - { - if (Url.IsLocalUrl(returnUrl)) - { - return Redirect(returnUrl); - } - return RedirectToAction("Index", "Home"); - } - - internal class ChallengeResult : HttpUnauthorizedResult - { - public ChallengeResult(string provider, string redirectUri) - : this(provider, redirectUri, null) - { - } - - public ChallengeResult(string provider, string redirectUri, string userId) - { - LoginProvider = provider; - RedirectUri = redirectUri; - UserId = userId; - } - - public string LoginProvider { get; set; } - public string RedirectUri { get; set; } - public string UserId { get; set; } - - public override void ExecuteResult(ControllerContext context) - { - var properties = new AuthenticationProperties { RedirectUri = RedirectUri }; - if (UserId != null) - { - properties.Dictionary[XsrfKey] = UserId; - } - context.HttpContext.GetOwinContext().Authentication.Challenge(properties, LoginProvider); - } - } - #endregion - } -} \ No newline at end of file diff --git a/AspNet4/Mvc/AdhocReporting/Controllers/EasyQuery/EasyReportController.cs b/AspNet4/Mvc/AdhocReporting/Controllers/EasyQuery/EasyReportController.cs deleted file mode 100644 index 23eab46c..00000000 --- a/AspNet4/Mvc/AdhocReporting/Controllers/EasyQuery/EasyReportController.cs +++ /dev/null @@ -1,60 +0,0 @@ -using System; -using System.Web.Http; - -using Microsoft.AspNet.Identity.EntityFramework; - -using Korzh.EasyQuery; -using Korzh.EasyQuery.Services; -using Korzh.EasyQuery.AspNet; - -using EqDemo.Models; -using EqDemo.Services; -using System.Linq; - -namespace EqDemo.Controllers -{ - - [RoutePrefix("api/adhoc-reporting")] - [Authorize] - public class EasyReportController : EasyQueryApiController - { - protected override void ConfigureEasyQueryOptions(EasyQueryOptions options) - { - //use EasyQuery manager that generates SQL queries - options.UseManager(); - - options.DefaultModelId = "adhoc-reporting"; - - options.StoreModelInCache = true; - //it is required to register caching service, when StoreInCache is turned on - options.UseCaching((_) => new EqSessionCachingService()); - - //allow save query on sync for users with eq-manager role - options.SaveQueryOnSync = User.IsInRole("eq-manager"); - options.SaveNewQuery = true; - - var dbContext = ApplicationDbContext.Create(); - options.UseDbContext(dbContext, config => { - // Ignore identity tables - config.AddFilter((entityMap) => { - - var entType = entityMap.Type; - return !(entType.IsInheritedFromGeneric(typeof(IdentityUser<,,,>)) - || entType.IsInheritedFromGeneric(typeof(IdentityUserClaim<>)) - || entType.IsInheritedFromGeneric(typeof(IdentityUserRole<>)) - || entType.IsInheritedFromGeneric(typeof(IdentityUserLogin<>)) - || entType.IsInheritedFromGeneric(typeof(IdentityRole<,>))); - }); - - // Ignore reports table - config.AddFilter((entityMap) => { - - var entType = entityMap.Type; - return entType != typeof(Report); - }); - }); - - options.UseQueryStore((_) => new ReportStore(dbContext, User)); - } - } -} \ No newline at end of file diff --git a/AspNet4/Mvc/AdhocReporting/Controllers/HomeController.cs b/AspNet4/Mvc/AdhocReporting/Controllers/HomeController.cs index c655c924..594b6dd0 100644 --- a/AspNet4/Mvc/AdhocReporting/Controllers/HomeController.cs +++ b/AspNet4/Mvc/AdhocReporting/Controllers/HomeController.cs @@ -1,19 +1,12 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web; -using System.Web.Mvc; +using Microsoft.AspNetCore.Mvc; namespace EqDemo.Controllers { - [Route("/")] public class HomeController : Controller { - [Authorize] - [Route("")] - public ActionResult Index() + public IActionResult Index() { return View(); } } -} \ No newline at end of file +} diff --git a/AspNet4/Mvc/AdhocReporting/Controllers/ManageController.cs b/AspNet4/Mvc/AdhocReporting/Controllers/ManageController.cs deleted file mode 100644 index 30b3b9c3..00000000 --- a/AspNet4/Mvc/AdhocReporting/Controllers/ManageController.cs +++ /dev/null @@ -1,389 +0,0 @@ -using System; -using System.Linq; -using System.Threading.Tasks; -using System.Web; -using System.Web.Mvc; -using Microsoft.AspNet.Identity; -using Microsoft.AspNet.Identity.Owin; -using Microsoft.Owin.Security; -using EqDemo.Models; - -namespace EqDemo.Controllers -{ - [Authorize] - public class ManageController : Controller - { - private ApplicationSignInManager _signInManager; - private ApplicationUserManager _userManager; - - public ManageController() - { - } - - public ManageController(ApplicationUserManager userManager, ApplicationSignInManager signInManager) - { - UserManager = userManager; - SignInManager = signInManager; - } - - public ApplicationSignInManager SignInManager - { - get - { - return _signInManager ?? HttpContext.GetOwinContext().Get(); - } - private set - { - _signInManager = value; - } - } - - public ApplicationUserManager UserManager - { - get - { - return _userManager ?? HttpContext.GetOwinContext().GetUserManager(); - } - private set - { - _userManager = value; - } - } - - // - // GET: /Manage/Index - public async Task Index(ManageMessageId? message) - { - ViewBag.StatusMessage = - message == ManageMessageId.ChangePasswordSuccess ? "Your password has been changed." - : message == ManageMessageId.SetPasswordSuccess ? "Your password has been set." - : message == ManageMessageId.SetTwoFactorSuccess ? "Your two-factor authentication provider has been set." - : message == ManageMessageId.Error ? "An error has occurred." - : message == ManageMessageId.AddPhoneSuccess ? "Your phone number was added." - : message == ManageMessageId.RemovePhoneSuccess ? "Your phone number was removed." - : ""; - - var userId = User.Identity.GetUserId(); - var model = new IndexViewModel - { - HasPassword = HasPassword(), - PhoneNumber = await UserManager.GetPhoneNumberAsync(userId), - TwoFactor = await UserManager.GetTwoFactorEnabledAsync(userId), - Logins = await UserManager.GetLoginsAsync(userId), - BrowserRemembered = await AuthenticationManager.TwoFactorBrowserRememberedAsync(userId) - }; - return View(model); - } - - // - // POST: /Manage/RemoveLogin - [HttpPost] - [ValidateAntiForgeryToken] - public async Task RemoveLogin(string loginProvider, string providerKey) - { - ManageMessageId? message; - var result = await UserManager.RemoveLoginAsync(User.Identity.GetUserId(), new UserLoginInfo(loginProvider, providerKey)); - if (result.Succeeded) - { - var user = await UserManager.FindByIdAsync(User.Identity.GetUserId()); - if (user != null) - { - await SignInManager.SignInAsync(user, isPersistent: false, rememberBrowser: false); - } - message = ManageMessageId.RemoveLoginSuccess; - } - else - { - message = ManageMessageId.Error; - } - return RedirectToAction("ManageLogins", new { Message = message }); - } - - // - // GET: /Manage/AddPhoneNumber - public ActionResult AddPhoneNumber() - { - return View(); - } - - // - // POST: /Manage/AddPhoneNumber - [HttpPost] - [ValidateAntiForgeryToken] - public async Task AddPhoneNumber(AddPhoneNumberViewModel model) - { - if (!ModelState.IsValid) - { - return View(model); - } - // Generate the token and send it - var code = await UserManager.GenerateChangePhoneNumberTokenAsync(User.Identity.GetUserId(), model.Number); - if (UserManager.SmsService != null) - { - var message = new IdentityMessage - { - Destination = model.Number, - Body = "Your security code is: " + code - }; - await UserManager.SmsService.SendAsync(message); - } - return RedirectToAction("VerifyPhoneNumber", new { PhoneNumber = model.Number }); - } - - // - // POST: /Manage/EnableTwoFactorAuthentication - [HttpPost] - [ValidateAntiForgeryToken] - public async Task EnableTwoFactorAuthentication() - { - await UserManager.SetTwoFactorEnabledAsync(User.Identity.GetUserId(), true); - var user = await UserManager.FindByIdAsync(User.Identity.GetUserId()); - if (user != null) - { - await SignInManager.SignInAsync(user, isPersistent: false, rememberBrowser: false); - } - return RedirectToAction("Index", "Manage"); - } - - // - // POST: /Manage/DisableTwoFactorAuthentication - [HttpPost] - [ValidateAntiForgeryToken] - public async Task DisableTwoFactorAuthentication() - { - await UserManager.SetTwoFactorEnabledAsync(User.Identity.GetUserId(), false); - var user = await UserManager.FindByIdAsync(User.Identity.GetUserId()); - if (user != null) - { - await SignInManager.SignInAsync(user, isPersistent: false, rememberBrowser: false); - } - return RedirectToAction("Index", "Manage"); - } - - // - // GET: /Manage/VerifyPhoneNumber - public async Task VerifyPhoneNumber(string phoneNumber) - { - var code = await UserManager.GenerateChangePhoneNumberTokenAsync(User.Identity.GetUserId(), phoneNumber); - // Send an SMS through the SMS provider to verify the phone number - return phoneNumber == null ? View("Error") : View(new VerifyPhoneNumberViewModel { PhoneNumber = phoneNumber }); - } - - // - // POST: /Manage/VerifyPhoneNumber - [HttpPost] - [ValidateAntiForgeryToken] - public async Task VerifyPhoneNumber(VerifyPhoneNumberViewModel model) - { - if (!ModelState.IsValid) - { - return View(model); - } - var result = await UserManager.ChangePhoneNumberAsync(User.Identity.GetUserId(), model.PhoneNumber, model.Code); - if (result.Succeeded) - { - var user = await UserManager.FindByIdAsync(User.Identity.GetUserId()); - if (user != null) - { - await SignInManager.SignInAsync(user, isPersistent: false, rememberBrowser: false); - } - return RedirectToAction("Index", new { Message = ManageMessageId.AddPhoneSuccess }); - } - // If we got this far, something failed, redisplay form - ModelState.AddModelError("", "Failed to verify phone"); - return View(model); - } - - // - // POST: /Manage/RemovePhoneNumber - [HttpPost] - [ValidateAntiForgeryToken] - public async Task RemovePhoneNumber() - { - var result = await UserManager.SetPhoneNumberAsync(User.Identity.GetUserId(), null); - if (!result.Succeeded) - { - return RedirectToAction("Index", new { Message = ManageMessageId.Error }); - } - var user = await UserManager.FindByIdAsync(User.Identity.GetUserId()); - if (user != null) - { - await SignInManager.SignInAsync(user, isPersistent: false, rememberBrowser: false); - } - return RedirectToAction("Index", new { Message = ManageMessageId.RemovePhoneSuccess }); - } - - // - // GET: /Manage/ChangePassword - public ActionResult ChangePassword() - { - return View(); - } - - // - // POST: /Manage/ChangePassword - [HttpPost] - [ValidateAntiForgeryToken] - public async Task ChangePassword(ChangePasswordViewModel model) - { - if (!ModelState.IsValid) - { - return View(model); - } - var result = await UserManager.ChangePasswordAsync(User.Identity.GetUserId(), model.OldPassword, model.NewPassword); - if (result.Succeeded) - { - var user = await UserManager.FindByIdAsync(User.Identity.GetUserId()); - if (user != null) - { - await SignInManager.SignInAsync(user, isPersistent: false, rememberBrowser: false); - } - return RedirectToAction("Index", new { Message = ManageMessageId.ChangePasswordSuccess }); - } - AddErrors(result); - return View(model); - } - - // - // GET: /Manage/SetPassword - public ActionResult SetPassword() - { - return View(); - } - - // - // POST: /Manage/SetPassword - [HttpPost] - [ValidateAntiForgeryToken] - public async Task SetPassword(SetPasswordViewModel model) - { - if (ModelState.IsValid) - { - var result = await UserManager.AddPasswordAsync(User.Identity.GetUserId(), model.NewPassword); - if (result.Succeeded) - { - var user = await UserManager.FindByIdAsync(User.Identity.GetUserId()); - if (user != null) - { - await SignInManager.SignInAsync(user, isPersistent: false, rememberBrowser: false); - } - return RedirectToAction("Index", new { Message = ManageMessageId.SetPasswordSuccess }); - } - AddErrors(result); - } - - // If we got this far, something failed, redisplay form - return View(model); - } - - // - // GET: /Manage/ManageLogins - public async Task ManageLogins(ManageMessageId? message) - { - ViewBag.StatusMessage = - message == ManageMessageId.RemoveLoginSuccess ? "The external login was removed." - : message == ManageMessageId.Error ? "An error has occurred." - : ""; - var user = await UserManager.FindByIdAsync(User.Identity.GetUserId()); - if (user == null) - { - return View("Error"); - } - var userLogins = await UserManager.GetLoginsAsync(User.Identity.GetUserId()); - var otherLogins = AuthenticationManager.GetExternalAuthenticationTypes().Where(auth => userLogins.All(ul => auth.AuthenticationType != ul.LoginProvider)).ToList(); - ViewBag.ShowRemoveButton = user.PasswordHash != null || userLogins.Count > 1; - return View(new ManageLoginsViewModel - { - CurrentLogins = userLogins, - OtherLogins = otherLogins - }); - } - - // - // POST: /Manage/LinkLogin - [HttpPost] - [ValidateAntiForgeryToken] - public ActionResult LinkLogin(string provider) - { - // Request a redirect to the external login provider to link a login for the current user - return new AccountController.ChallengeResult(provider, Url.Action("LinkLoginCallback", "Manage"), User.Identity.GetUserId()); - } - - // - // GET: /Manage/LinkLoginCallback - public async Task LinkLoginCallback() - { - var loginInfo = await AuthenticationManager.GetExternalLoginInfoAsync(XsrfKey, User.Identity.GetUserId()); - if (loginInfo == null) - { - return RedirectToAction("ManageLogins", new { Message = ManageMessageId.Error }); - } - var result = await UserManager.AddLoginAsync(User.Identity.GetUserId(), loginInfo.Login); - return result.Succeeded ? RedirectToAction("ManageLogins") : RedirectToAction("ManageLogins", new { Message = ManageMessageId.Error }); - } - - protected override void Dispose(bool disposing) - { - if (disposing && _userManager != null) - { - _userManager.Dispose(); - _userManager = null; - } - - base.Dispose(disposing); - } - -#region Helpers - // Used for XSRF protection when adding external logins - private const string XsrfKey = "XsrfId"; - - private IAuthenticationManager AuthenticationManager - { - get - { - return HttpContext.GetOwinContext().Authentication; - } - } - - private void AddErrors(IdentityResult result) - { - foreach (var error in result.Errors) - { - ModelState.AddModelError("", error); - } - } - - private bool HasPassword() - { - var user = UserManager.FindById(User.Identity.GetUserId()); - if (user != null) - { - return user.PasswordHash != null; - } - return false; - } - - private bool HasPhoneNumber() - { - var user = UserManager.FindById(User.Identity.GetUserId()); - if (user != null) - { - return user.PhoneNumber != null; - } - return false; - } - - public enum ManageMessageId - { - AddPhoneSuccess, - ChangePasswordSuccess, - SetTwoFactorSuccess, - SetPasswordSuccess, - RemoveLoginSuccess, - RemovePhoneSuccess, - Error - } - -#endregion - } -} \ No newline at end of file diff --git a/AspNet4/Mvc/AdhocReporting/Data/ApplicationDbContext.cs b/AspNet4/Mvc/AdhocReporting/Data/ApplicationDbContext.cs index 489b4f6d..42839e79 100644 --- a/AspNet4/Mvc/AdhocReporting/Data/ApplicationDbContext.cs +++ b/AspNet4/Mvc/AdhocReporting/Data/ApplicationDbContext.cs @@ -1,19 +1,16 @@ -using System.Data.Entity; - -using Microsoft.AspNet.Identity.EntityFramework; +using Microsoft.AspNetCore.Identity.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; namespace EqDemo.Models { public class ApplicationDbContext : IdentityDbContext { - public ApplicationDbContext() - : base("DefaultConnection", throwIfV1Schema: false) + public ApplicationDbContext(DbContextOptions options) + : base(options) { } - - #region NWind public DbSet Categories { get; set; } @@ -35,7 +32,7 @@ public ApplicationDbContext() public DbSet Reports { get; set; } - protected override void OnModelCreating(DbModelBuilder modelBuilder) + protected override void OnModelCreating(ModelBuilder modelBuilder) { base.OnModelCreating(modelBuilder); @@ -44,11 +41,6 @@ protected override void OnModelCreating(DbModelBuilder modelBuilder) .HasKey(od => new { od.OrderID, od.ProductID }); } - public static ApplicationDbContext Create() - { - return new ApplicationDbContext(); - } - } -} \ No newline at end of file +} diff --git a/AspNet4/Mvc/AdhocReporting/EqDemo.AspNet4x.AdhocReporting.csproj b/AspNet4/Mvc/AdhocReporting/EqDemo.AspNet4x.AdhocReporting.csproj index cdad6956..a238a2b3 100644 --- a/AspNet4/Mvc/AdhocReporting/EqDemo.AspNet4x.AdhocReporting.csproj +++ b/AspNet4/Mvc/AdhocReporting/EqDemo.AspNet4x.AdhocReporting.csproj @@ -1,302 +1,33 @@ - - - - - - Debug - AnyCPU - - - 2.0 - {420AEDD8-5D2E-4994-95B8-67644681C908} - {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - Library - Properties - EqDemo - EqDemo.AspNet4x.AdhocReporting - v4.6.2 - false - true - - 44378 - - - - - - - - - true - full - false - bin\ - DEBUG;TRACE - prompt - 4 - - - true - pdbonly - true - bin\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 7.4.0-rc04 - - - 2.1.7 - - - 13.0.3 - - - 4.8.6 - - - 6.0.0 - - - 7.1.2 - - - 1.6.0 - - - 5.2.7 - - - 5.2.7 - - - 5.2.7 - - - 3.2.7 - - - 3.2.7 - - - 1.1.3 - - - 1.0.0 - - - 2.2.4 - - - 2.2.2 - - - 6.2.0 - - - 2.0.0 - - - 1.0.0 - - - 4.2.2 - - - 4.2.2 - - - 4.2.2 - - - 4.2.2 - - - 4.2.2 - - - 3.5.1 - - - 7.6.0 - - - - - - - - - - - - - - - - - - - - - - - - - Global.asax - - - - - 201907161537049_InitialCreate.cs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Designer - - - Web.config - - - Web.config - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 201907161537049_InitialCreate.cs - - - - - ~/App_Data/EqDemoData.zip - - - - 10.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - - - - - - - - - True - True - 49981 - / - https://localhost:44378/ - False - False - - - False - - - - - - - - - - - - \ No newline at end of file + + + net8.0 + EqDemo + + + + + + + + + + + + + + + + + + + + + + + + + + PreserveNewest + + + diff --git a/AspNet4/Mvc/AdhocReporting/Global.asax b/AspNet4/Mvc/AdhocReporting/Global.asax deleted file mode 100644 index c3267ad8..00000000 --- a/AspNet4/Mvc/AdhocReporting/Global.asax +++ /dev/null @@ -1 +0,0 @@ -<%@ Application Codebehind="Global.asax.cs" Inherits="EqDemo.MvcApplication" Language="C#" %> diff --git a/AspNet4/Mvc/AdhocReporting/Global.asax.cs b/AspNet4/Mvc/AdhocReporting/Global.asax.cs deleted file mode 100644 index ba3f72e7..00000000 --- a/AspNet4/Mvc/AdhocReporting/Global.asax.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web; -using System.Web.Http; -using System.Web.Mvc; -using System.Web.Optimization; -using System.Web.Routing; - -namespace EqDemo -{ - public class MvcApplication : System.Web.HttpApplication - { - protected void Application_Start() - { - AreaRegistration.RegisterAllAreas(); - GlobalConfiguration.Configure(WebApiConfig.Register); - FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); - RouteConfig.RegisterRoutes(RouteTable.Routes); - BundleConfig.RegisterBundles(BundleTable.Bundles); - - GlobalConfiguration.Configuration.EnsureInitialized(); - } - - void Session_Start(object sender, EventArgs e) - { - // Code that runs when a new session is started - string sessionId = Session.SessionID; - } - - protected void Application_PostAuthorizeRequest() - { - //here we enable session for WebApi Controllers - System.Web.HttpContext.Current.SetSessionStateBehavior(System.Web.SessionState.SessionStateBehavior.Required); - } - } -} diff --git a/AspNet4/Mvc/AdhocReporting/IdentityHelper.cs b/AspNet4/Mvc/AdhocReporting/IdentityHelper.cs deleted file mode 100644 index 5559fe28..00000000 --- a/AspNet4/Mvc/AdhocReporting/IdentityHelper.cs +++ /dev/null @@ -1,80 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web; - -using Microsoft.AspNet.Identity; -using Microsoft.AspNet.Identity.EntityFramework; - -using EqDemo.Models; -using EqDemo.Services; -using System.Configuration; - -namespace EqDemo -{ - internal static class IdentityHelper - { - - public static void SeedEqManagerRole() - { - - const string eqManagerRole = "eq-manager"; - - using (var context = ApplicationDbContext.Create()) - { - var roleManager = new RoleManager(new RoleStore(context)); - if (!roleManager.RoleExists(eqManagerRole)) { - roleManager.Create(new IdentityRole { Name = eqManagerRole }); - } - } - } - - public static void SeedDefaultUser() - { - const string defaultUserEmail = "demo@korzh.com"; - const string defaultUserPassword = "demo"; - - using (var dbContext = ApplicationDbContext.Create()) - { - var userManager = new UserManager(new UserStore(dbContext)); - // Configure validation logic for passwords - userManager.PasswordValidator = new PasswordValidator - { - RequiredLength = 4, - RequireNonLetterOrDigit = false, - RequireDigit = false, - RequireLowercase = false, - RequireUppercase = false, - }; - - var resetDemoUserStr = ConfigurationManager.AppSettings["resetDefaultUser"]; - var resetDemoUser = resetDemoUserStr != null ? bool.Parse(resetDemoUserStr) : false; - - var user = userManager.FindByEmail(defaultUserEmail); - - //remove default user if "resetDefaultUser" option is set to true - if (resetDemoUser && user != null) { - dbContext.Reports.RemoveRange(dbContext.Reports.Where(r => r.OwnerId == user.Id)); - dbContext.SaveChanges(); - - userManager.DeleteAsync(user).GetAwaiter().GetResult(); - user = null; - } - - if (user == null) { - user = new ApplicationUser { - Email = defaultUserEmail, - UserName = defaultUserEmail, - EmailConfirmed = true - }; - - var result = userManager.Create(user, defaultUserPassword); - if (result.Succeeded) { - var reportGenerator = new DefaultReportGenerator(dbContext); - reportGenerator.Generate(user); - } - } - } - } - } -} \ No newline at end of file diff --git a/AspNet4/Mvc/AdhocReporting/Migrations/201907161537049_InitialCreate.Designer.cs b/AspNet4/Mvc/AdhocReporting/Migrations/201907161537049_InitialCreate.Designer.cs deleted file mode 100644 index dc17d5a8..00000000 --- a/AspNet4/Mvc/AdhocReporting/Migrations/201907161537049_InitialCreate.Designer.cs +++ /dev/null @@ -1,29 +0,0 @@ -// -namespace EqDemo.Migrations -{ - using System.CodeDom.Compiler; - using System.Data.Entity.Migrations; - using System.Data.Entity.Migrations.Infrastructure; - using System.Resources; - - [GeneratedCode("EntityFramework.Migrations", "6.2.0-61023")] - public sealed partial class InitialCreate : IMigrationMetadata - { - private readonly ResourceManager Resources = new ResourceManager(typeof(InitialCreate)); - - string IMigrationMetadata.Id - { - get { return "201907161537049_InitialCreate"; } - } - - string IMigrationMetadata.Source - { - get { return null; } - } - - string IMigrationMetadata.Target - { - get { return Resources.GetString("Target"); } - } - } -} diff --git a/AspNet4/Mvc/AdhocReporting/Migrations/201907161537049_InitialCreate.cs b/AspNet4/Mvc/AdhocReporting/Migrations/201907161537049_InitialCreate.cs deleted file mode 100644 index f0c41b39..00000000 --- a/AspNet4/Mvc/AdhocReporting/Migrations/201907161537049_InitialCreate.cs +++ /dev/null @@ -1,302 +0,0 @@ -namespace EqDemo.Migrations -{ - using System; - using System.Data.Entity.Migrations; - - public partial class InitialCreate : DbMigration - { - public override void Up() - { - CreateTable( - "dbo.Categories", - c => new - { - CategoryID = c.Int(nullable: false), - CategoryName = c.String(), - Description = c.String(), - Picture = c.Binary(), - }) - .PrimaryKey(t => t.CategoryID); - - CreateTable( - "dbo.Customers", - c => new - { - CustomerID = c.String(nullable: false, maxLength: 128), - CompanyName = c.String(), - Address = c.String(), - City = c.String(), - Region = c.String(), - PostalCode = c.String(), - Country = c.String(), - ContactName = c.String(), - ContactTitle = c.String(), - Phone = c.String(), - Fax = c.String(), - }) - .PrimaryKey(t => t.CustomerID); - - CreateTable( - "dbo.Employees", - c => new - { - EmployeeID = c.Int(nullable: false), - LastName = c.String(nullable: false), - FirstName = c.String(nullable: false), - Title = c.String(maxLength: 30), - TitleOfCourtesy = c.String(), - BirthDate = c.DateTime(), - HireDate = c.DateTime(), - Address = c.String(), - City = c.String(), - Region = c.String(), - PostalCode = c.String(), - Country = c.String(), - HomePhone = c.String(maxLength: 24), - Extension = c.String(maxLength: 4), - Photo = c.Binary(), - PhotoPath = c.String(), - Notes = c.String(), - ReportsTo = c.Int(), - }) - .PrimaryKey(t => t.EmployeeID) - .ForeignKey("dbo.Employees", t => t.ReportsTo) - .Index(t => t.ReportsTo); - - CreateTable( - "dbo.Orders", - c => new - { - OrderID = c.Int(nullable: false), - OrderDate = c.DateTime(), - RequiredDate = c.DateTime(), - ShippedDate = c.DateTime(), - Freight = c.Decimal(precision: 18, scale: 2), - CustomerID = c.String(maxLength: 128), - EmployeeID = c.Int(), - ShipVia = c.Int(), - ShipName = c.String(), - ShipAddress = c.String(), - ShipCity = c.String(), - ShipRegion = c.String(), - ShipPostalCode = c.String(), - ShipCountry = c.String(), - }) - .PrimaryKey(t => t.OrderID) - .ForeignKey("dbo.Customers", t => t.CustomerID) - .ForeignKey("dbo.Employees", t => t.EmployeeID) - .Index(t => t.CustomerID) - .Index(t => t.EmployeeID); - - CreateTable( - "dbo.Order_Details", - c => new - { - OrderID = c.Int(nullable: false), - ProductID = c.Int(nullable: false), - UnitPrice = c.Decimal(nullable: false, precision: 18, scale: 2), - Quantity = c.Short(nullable: false), - Discount = c.Single(nullable: false), - }) - .PrimaryKey(t => new { t.OrderID, t.ProductID }) - .ForeignKey("dbo.Orders", t => t.OrderID, cascadeDelete: true) - .ForeignKey("dbo.Products", t => t.ProductID, cascadeDelete: true) - .Index(t => t.OrderID) - .Index(t => t.ProductID); - - CreateTable( - "dbo.Products", - c => new - { - ProductID = c.Int(nullable: false), - ProductName = c.String(), - SupplierID = c.Int(), - CategoryID = c.Int(), - QuantityPerUnit = c.String(), - UnitPrice = c.Decimal(precision: 18, scale: 2), - UnitsInStock = c.Short(), - UnitsOnOrder = c.Short(), - ReorderLevel = c.Short(), - Discontinued = c.Boolean(nullable: false), - }) - .PrimaryKey(t => t.ProductID) - .ForeignKey("dbo.Categories", t => t.CategoryID) - .ForeignKey("dbo.Suppliers", t => t.SupplierID) - .Index(t => t.SupplierID) - .Index(t => t.CategoryID); - - CreateTable( - "dbo.Suppliers", - c => new - { - SupplierID = c.Int(nullable: false, identity: true), - CompanyName = c.String(), - ContactName = c.String(), - ContactTitle = c.String(), - Address = c.String(), - City = c.String(), - Region = c.String(), - PostalCode = c.String(), - Country = c.String(), - Phone = c.String(), - Fax = c.String(), - HomePage = c.String(), - }) - .PrimaryKey(t => t.SupplierID); - - CreateTable( - "dbo.Reports", - c => new - { - Id = c.String(nullable: false, maxLength: 128), - Name = c.String(), - Description = c.String(), - ModelId = c.String(), - QueryJson = c.String(), - OwnerId = c.String(maxLength: 128), - }) - .PrimaryKey(t => t.Id) - .ForeignKey("dbo.IdentityUsers", t => t.OwnerId) - .Index(t => t.OwnerId); - - CreateTable( - "dbo.IdentityUsers", - c => new - { - Id = c.String(nullable: false, maxLength: 128), - Email = c.String(maxLength: 256), - EmailConfirmed = c.Boolean(nullable: false), - PasswordHash = c.String(), - SecurityStamp = c.String(), - PhoneNumber = c.String(), - PhoneNumberConfirmed = c.Boolean(nullable: false), - TwoFactorEnabled = c.Boolean(nullable: false), - LockoutEndDateUtc = c.DateTime(), - LockoutEnabled = c.Boolean(nullable: false), - AccessFailedCount = c.Int(nullable: false), - UserName = c.String(nullable: false, maxLength: 256), - }) - .PrimaryKey(t => t.Id) - .Index(t => t.UserName, unique: true, name: "UserNameIndex"); - - CreateTable( - "dbo.AspNetUserClaims", - c => new - { - Id = c.Int(nullable: false, identity: true), - UserId = c.String(), - ClaimType = c.String(), - ClaimValue = c.String(), - IdentityUser_Id = c.String(maxLength: 128), - }) - .PrimaryKey(t => t.Id) - .ForeignKey("dbo.IdentityUsers", t => t.IdentityUser_Id) - .Index(t => t.IdentityUser_Id); - - CreateTable( - "dbo.AspNetUserLogins", - c => new - { - LoginProvider = c.String(nullable: false, maxLength: 128), - ProviderKey = c.String(nullable: false, maxLength: 128), - UserId = c.String(nullable: false, maxLength: 128), - IdentityUser_Id = c.String(maxLength: 128), - }) - .PrimaryKey(t => new { t.LoginProvider, t.ProviderKey, t.UserId }) - .ForeignKey("dbo.IdentityUsers", t => t.IdentityUser_Id) - .Index(t => t.IdentityUser_Id); - - CreateTable( - "dbo.AspNetUserRoles", - c => new - { - UserId = c.String(nullable: false, maxLength: 128), - RoleId = c.String(nullable: false, maxLength: 128), - IdentityUser_Id = c.String(maxLength: 128), - }) - .PrimaryKey(t => new { t.UserId, t.RoleId }) - .ForeignKey("dbo.IdentityUsers", t => t.IdentityUser_Id) - .ForeignKey("dbo.AspNetRoles", t => t.RoleId, cascadeDelete: true) - .Index(t => t.RoleId) - .Index(t => t.IdentityUser_Id); - - CreateTable( - "dbo.AspNetRoles", - c => new - { - Id = c.String(nullable: false, maxLength: 128), - Name = c.String(nullable: false, maxLength: 256), - }) - .PrimaryKey(t => t.Id) - .Index(t => t.Name, unique: true, name: "RoleNameIndex"); - - CreateTable( - "dbo.Shippers", - c => new - { - ShipperID = c.Int(nullable: false, identity: true), - CompanyName = c.String(), - Phone = c.String(), - }) - .PrimaryKey(t => t.ShipperID); - - CreateTable( - "dbo.AspNetUsers", - c => new - { - Id = c.String(nullable: false, maxLength: 128), - }) - .PrimaryKey(t => t.Id) - .ForeignKey("dbo.IdentityUsers", t => t.Id) - .Index(t => t.Id); - - } - - public override void Down() - { - DropForeignKey("dbo.AspNetUsers", "Id", "dbo.IdentityUsers"); - DropForeignKey("dbo.AspNetUserRoles", "RoleId", "dbo.AspNetRoles"); - DropForeignKey("dbo.Reports", "OwnerId", "dbo.IdentityUsers"); - DropForeignKey("dbo.AspNetUserRoles", "IdentityUser_Id", "dbo.IdentityUsers"); - DropForeignKey("dbo.AspNetUserLogins", "IdentityUser_Id", "dbo.IdentityUsers"); - DropForeignKey("dbo.AspNetUserClaims", "IdentityUser_Id", "dbo.IdentityUsers"); - DropForeignKey("dbo.Order_Details", "ProductID", "dbo.Products"); - DropForeignKey("dbo.Products", "SupplierID", "dbo.Suppliers"); - DropForeignKey("dbo.Products", "CategoryID", "dbo.Categories"); - DropForeignKey("dbo.Order_Details", "OrderID", "dbo.Orders"); - DropForeignKey("dbo.Orders", "EmployeeID", "dbo.Employees"); - DropForeignKey("dbo.Orders", "CustomerID", "dbo.Customers"); - DropForeignKey("dbo.Employees", "ReportsTo", "dbo.Employees"); - DropIndex("dbo.AspNetUsers", new[] { "Id" }); - DropIndex("dbo.AspNetRoles", "RoleNameIndex"); - DropIndex("dbo.AspNetUserRoles", new[] { "IdentityUser_Id" }); - DropIndex("dbo.AspNetUserRoles", new[] { "RoleId" }); - DropIndex("dbo.AspNetUserLogins", new[] { "IdentityUser_Id" }); - DropIndex("dbo.AspNetUserClaims", new[] { "IdentityUser_Id" }); - DropIndex("dbo.IdentityUsers", "UserNameIndex"); - DropIndex("dbo.Reports", new[] { "OwnerId" }); - DropIndex("dbo.Products", new[] { "CategoryID" }); - DropIndex("dbo.Products", new[] { "SupplierID" }); - DropIndex("dbo.Order_Details", new[] { "ProductID" }); - DropIndex("dbo.Order_Details", new[] { "OrderID" }); - DropIndex("dbo.Orders", new[] { "EmployeeID" }); - DropIndex("dbo.Orders", new[] { "CustomerID" }); - DropIndex("dbo.Employees", new[] { "ReportsTo" }); - DropTable("dbo.AspNetUsers"); - DropTable("dbo.Shippers"); - DropTable("dbo.AspNetRoles"); - DropTable("dbo.AspNetUserRoles"); - DropTable("dbo.AspNetUserLogins"); - DropTable("dbo.AspNetUserClaims"); - DropTable("dbo.IdentityUsers"); - DropTable("dbo.Reports"); - DropTable("dbo.Suppliers"); - DropTable("dbo.Products"); - DropTable("dbo.Order_Details"); - DropTable("dbo.Orders"); - DropTable("dbo.Employees"); - DropTable("dbo.Customers"); - DropTable("dbo.Categories"); - } - } -} diff --git a/AspNet4/Mvc/AdhocReporting/Migrations/201907161537049_InitialCreate.resx b/AspNet4/Mvc/AdhocReporting/Migrations/201907161537049_InitialCreate.resx deleted file mode 100644 index 27d94ce8..00000000 --- a/AspNet4/Mvc/AdhocReporting/Migrations/201907161537049_InitialCreate.resx +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - H4sIAAAAAAAEAO1dzW7kOJK+L7DvkMjTzKLGWba7C70FewYu/8x4t6rsKbsbezNkJW0LrZSyJWV1GYt5sj3sI+0rLCXxnwyKlChlusbwJc2fL8hgMEgFI8j/+5//PfrLt1U6+4qKMsmz4/n+3tv5DGVxvkyyx+P5pnr400/zv/z5X//l6Hy5+jb7hZY7rMvhmll5PH+qqvX7xaKMn9AqKvdWSVzkZf5Q7cX5ahEt88XB27f/vtjfXyAMMcdYs9nRl01WJSvU/IP/Pc2zGK2rTZR+ypcoLUk6zrlpUGefoxUq11GMjufnv52U68+o+uEMrfK9tvx8dpImEW7LDUof5rMoy/IqqnBL3/9copuqyLPHmzVOiNLb5zXC5R6itESkB+95cdfOvD2oO7PgFSlUvCmrfOUJuH9IuLNQq/fi8ZxxD/PvHPO5eq573fDweH4aVegxL57nM5XY+9O0qAuaWbxHK76ZSdlvmFBg2an/3sxON2m1KdBxhjZVEaVvZteb+zSJ/xM93+a/ouw426Sp2EjcTJwnJeCk6yJfo6J6/oIeS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gZLYfnSXRYxGtSoLB6+N/sQwvV9/+/P+ecLZXgQcBAA== - - - dbo - - \ No newline at end of file diff --git a/AspNet4/Mvc/AdhocReporting/Migrations/Configuration.cs b/AspNet4/Mvc/AdhocReporting/Migrations/Configuration.cs deleted file mode 100644 index 70d34a71..00000000 --- a/AspNet4/Mvc/AdhocReporting/Migrations/Configuration.cs +++ /dev/null @@ -1,33 +0,0 @@ -namespace EqDemo.Migrations -{ - using System; - using System.Data.Entity; - using System.Data.Entity.Migrations; - using System.IO; - using System.Linq; - - using Korzh.DbUtils; - - internal sealed class Configuration : DbMigrationsConfiguration - { - public Configuration() - { - AutomaticMigrationsEnabled = false; - ContextKey = "EqDemo.Models.ApplicationDbContext"; - } - - protected override void Seed(EqDemo.Models.ApplicationDbContext context) - { - // This method will be called after migrating to the latest version. - - // You can use the DbSet.AddOrUpdate() helper extension method - // to avoid creating duplicate seed data. - - Korzh.DbUtils.DbInitializer.Create(options => { - options.UseSqlServer(context.Database.Connection.ConnectionString); - options.UseZipPacker(System.Web.Hosting.HostingEnvironment.MapPath("~/App_Data/EqDemoData.zip")); - }) - .Seed(); - } - } -} diff --git a/AspNet4/Mvc/AdhocReporting/Models/AccountViewModels.cs b/AspNet4/Mvc/AdhocReporting/Models/AccountViewModels.cs deleted file mode 100644 index 59cc06d3..00000000 --- a/AspNet4/Mvc/AdhocReporting/Models/AccountViewModels.cs +++ /dev/null @@ -1,113 +0,0 @@ -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; - -namespace EqDemo.Models -{ - public class ExternalLoginConfirmationViewModel - { - [Required] - [Display(Name = "Email")] - public string Email { get; set; } - } - - public class ExternalLoginListViewModel - { - public string ReturnUrl { get; set; } - } - - public class SendCodeViewModel - { - public string SelectedProvider { get; set; } - public ICollection Providers { get; set; } - public string ReturnUrl { get; set; } - public bool RememberMe { get; set; } - } - - public class VerifyCodeViewModel - { - [Required] - public string Provider { get; set; } - - [Required] - [Display(Name = "Code")] - public string Code { get; set; } - public string ReturnUrl { get; set; } - - [Display(Name = "Remember this browser?")] - public bool RememberBrowser { get; set; } - - public bool RememberMe { get; set; } - } - - public class ForgotViewModel - { - [Required] - [Display(Name = "Email")] - public string Email { get; set; } - } - - public class LoginViewModel - { - [Required] - [Display(Name = "Email")] - [EmailAddress] - public string Email { get; set; } - - [Required] - [DataType(DataType.Password)] - [Display(Name = "Password")] - public string Password { get; set; } - - [Display(Name = "Remember me?")] - public bool RememberMe { get; set; } - - } - - public class RegisterViewModel - { - [Required] - [EmailAddress] - [Display(Name = "Email")] - public string Email { get; set; } - - [Required] - [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)] - [DataType(DataType.Password)] - [Display(Name = "Password")] - public string Password { get; set; } - - [DataType(DataType.Password)] - [Display(Name = "Confirm password")] - [Compare("Password", ErrorMessage = "The password and confirmation password do not match.")] - public string ConfirmPassword { get; set; } - } - - public class ResetPasswordViewModel - { - [Required] - [EmailAddress] - [Display(Name = "Email")] - public string Email { get; set; } - - [Required] - [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)] - [DataType(DataType.Password)] - [Display(Name = "Password")] - public string Password { get; set; } - - [DataType(DataType.Password)] - [Display(Name = "Confirm password")] - [Compare("Password", ErrorMessage = "The password and confirmation password do not match.")] - public string ConfirmPassword { get; set; } - - public string Code { get; set; } - } - - public class ForgotPasswordViewModel - { - [Required] - [EmailAddress] - [Display(Name = "Email")] - public string Email { get; set; } - } -} diff --git a/AspNet4/Mvc/AdhocReporting/Models/ApplicationUser.cs b/AspNet4/Mvc/AdhocReporting/Models/ApplicationUser.cs index 2695f02d..ef6ecbc1 100644 --- a/AspNet4/Mvc/AdhocReporting/Models/ApplicationUser.cs +++ b/AspNet4/Mvc/AdhocReporting/Models/ApplicationUser.cs @@ -1,21 +1,9 @@ -using System.Data.Entity; -using System.Security.Claims; -using System.Threading.Tasks; -using Microsoft.AspNet.Identity; -using Microsoft.AspNet.Identity.EntityFramework; +using Microsoft.AspNetCore.Identity; namespace EqDemo.Models { - // You can add profile data for the user by adding more properties to your ApplicationUser class, please visit https://go.microsoft.com/fwlink/?LinkID=317594 to learn more. public class ApplicationUser : IdentityUser { - public async Task GenerateUserIdentityAsync(UserManager manager) - { - // Note the authenticationType must match the one defined in CookieAuthenticationOptions.AuthenticationType - var userIdentity = await manager.CreateIdentityAsync(this, DefaultAuthenticationTypes.ApplicationCookie); - // Add custom user claims here - return userIdentity; - } } -} \ No newline at end of file +} diff --git a/AspNet4/Mvc/AdhocReporting/Models/IdentityModels.cs b/AspNet4/Mvc/AdhocReporting/Models/IdentityModels.cs deleted file mode 100644 index 21299219..00000000 --- a/AspNet4/Mvc/AdhocReporting/Models/IdentityModels.cs +++ /dev/null @@ -1,76 +0,0 @@ -using System.Data.Entity; -using System.Security.Claims; -using System.Threading.Tasks; -using Microsoft.AspNet.Identity; -using Microsoft.AspNet.Identity.EntityFramework; - -namespace EqAspNet4Demo.Models -{ - // You can add profile data for the user by adding more properties to your ApplicationUser class, please visit https://go.microsoft.com/fwlink/?LinkID=317594 to learn more. - public class ApplicationUser : IdentityUser - { - public async Task GenerateUserIdentityAsync(UserManager manager) - { - // Note the authenticationType must match the one defined in CookieAuthenticationOptions.AuthenticationType - var userIdentity = await manager.CreateIdentityAsync(this, DefaultAuthenticationTypes.ApplicationCookie); - // Add custom user claims here - return userIdentity; - } - } - - public class ApplicationDbContext : IdentityDbContext - { - public ApplicationDbContext() - : base("DefaultConnection", throwIfV1Schema: false) - { - Database.SetInitializer(new NwindInitializer()); - } - - - - #region NWind - public DbSet Categories { get; set; } - - public DbSet Customers { get; set; } - - public DbSet Employees { get; set; } - - public DbSet Orders { get; set; } - - public DbSet Products { get; set; } - - public DbSet OrderDetails { get; set; } - - public DbSet Shippers { get; set; } - - public DbSet Suppliers { get; set; } - - #endregion - - protected override void OnModelCreating(DbModelBuilder modelBuilder) - { - base.OnModelCreating(modelBuilder); - - modelBuilder.Entity() - .ToTable("Order_Details") - .HasKey(od => new { od.OrderID, od.ProductID }); - } - - public static ApplicationDbContext Create() - { - return new ApplicationDbContext(); - } - - } - - public class NwindInitializer : CreateDatabaseIfNotExists - { - protected override void Seed(ApplicationDbContext context) - { - base.Seed(context); - - var initializer = new DbIntializer(context.Database.Connection.ConnectionString); - initializer.AddTestData(); - } - } -} \ No newline at end of file diff --git a/AspNet4/Mvc/AdhocReporting/Models/ManageViewModels.cs b/AspNet4/Mvc/AdhocReporting/Models/ManageViewModels.cs deleted file mode 100644 index 265c15b3..00000000 --- a/AspNet4/Mvc/AdhocReporting/Models/ManageViewModels.cs +++ /dev/null @@ -1,86 +0,0 @@ -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using Microsoft.AspNet.Identity; -using Microsoft.Owin.Security; - -namespace EqDemo.Models -{ - public class IndexViewModel - { - public bool HasPassword { get; set; } - public IList Logins { get; set; } - public string PhoneNumber { get; set; } - public bool TwoFactor { get; set; } - public bool BrowserRemembered { get; set; } - } - - public class ManageLoginsViewModel - { - public IList CurrentLogins { get; set; } - public IList OtherLogins { get; set; } - } - - public class FactorViewModel - { - public string Purpose { get; set; } - } - - public class SetPasswordViewModel - { - [Required] - [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)] - [DataType(DataType.Password)] - [Display(Name = "New password")] - public string NewPassword { get; set; } - - [DataType(DataType.Password)] - [Display(Name = "Confirm new password")] - [Compare("NewPassword", ErrorMessage = "The new password and confirmation password do not match.")] - public string ConfirmPassword { get; set; } - } - - public class ChangePasswordViewModel - { - [Required] - [DataType(DataType.Password)] - [Display(Name = "Current password")] - public string OldPassword { get; set; } - - [Required] - [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)] - [DataType(DataType.Password)] - [Display(Name = "New password")] - public string NewPassword { get; set; } - - [DataType(DataType.Password)] - [Display(Name = "Confirm new password")] - [Compare("NewPassword", ErrorMessage = "The new password and confirmation password do not match.")] - public string ConfirmPassword { get; set; } - } - - public class AddPhoneNumberViewModel - { - [Required] - [Phone] - [Display(Name = "Phone Number")] - public string Number { get; set; } - } - - public class VerifyPhoneNumberViewModel - { - [Required] - [Display(Name = "Code")] - public string Code { get; set; } - - [Required] - [Phone] - [Display(Name = "Phone Number")] - public string PhoneNumber { get; set; } - } - - public class ConfigureTwoFactorViewModel - { - public string SelectedProvider { get; set; } - public ICollection Providers { get; set; } - } -} \ No newline at end of file diff --git a/AspNet4/Mvc/AdhocReporting/Models/Report.cs b/AspNet4/Mvc/AdhocReporting/Models/Report.cs index 3fa570d4..9c8d2f4a 100644 --- a/AspNet4/Mvc/AdhocReporting/Models/Report.cs +++ b/AspNet4/Mvc/AdhocReporting/Models/Report.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNet.Identity.EntityFramework; +using Microsoft.AspNetCore.Identity; namespace EqDemo.Models { @@ -18,4 +18,4 @@ public class Report public IdentityUser Owner { get; set; } } -} \ No newline at end of file +} diff --git a/AspNet4/Mvc/AdhocReporting/Program.cs b/AspNet4/Mvc/AdhocReporting/Program.cs new file mode 100644 index 00000000..83414752 --- /dev/null +++ b/AspNet4/Mvc/AdhocReporting/Program.cs @@ -0,0 +1,20 @@ +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Hosting; + +namespace EqDemo +{ + public class Program + { + public static void Main(string[] args) + { + CreateHostBuilder(args).Build().Run(); + } + + public static IHostBuilder CreateHostBuilder(string[] args) => + Host.CreateDefaultBuilder(args) + .ConfigureWebHostDefaults(webBuilder => + { + webBuilder.UseStartup(); + }); + } +} diff --git a/AspNet4/Mvc/AdhocReporting/Properties/AssemblyInfo.cs b/AspNet4/Mvc/AdhocReporting/Properties/AssemblyInfo.cs deleted file mode 100644 index fb52268c..00000000 --- a/AspNet4/Mvc/AdhocReporting/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("EqDemo.AspNet4x.AdhocReporting")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("EqDemo.AspNet4x.AdhocReporting")] -[assembly: AssemblyCopyright("Copyright © 2019")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("30fa8735-d1bd-4cb0-8237-c6485e7d406b")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/AspNet4/Mvc/AdhocReporting/Services/DefaultReportGenerator.cs b/AspNet4/Mvc/AdhocReporting/Services/DefaultReportGenerator.cs index 750ba929..5a777999 100644 --- a/AspNet4/Mvc/AdhocReporting/Services/DefaultReportGenerator.cs +++ b/AspNet4/Mvc/AdhocReporting/Services/DefaultReportGenerator.cs @@ -1,8 +1,8 @@ -using System; +using System; using System.Collections.Generic; using System.IO; -using Microsoft.AspNet.Identity.EntityFramework; +using Microsoft.AspNetCore.Identity; using Newtonsoft.Json.Linq; @@ -17,10 +17,10 @@ public class DefaultReportGenerator private const string _modelId = "adhoc-reporting"; - public DefaultReportGenerator(ApplicationDbContext dbContext) + public DefaultReportGenerator(ApplicationDbContext dbContext, string dataPath) { _dbContext = dbContext; - _dataPath = Path.Combine(System.Web.Hosting.HostingEnvironment.MapPath("~/App_Data"), "Seed"); + _dataPath = Path.Combine(dataPath, "Seed"); } public void Generate(IdentityUser user) @@ -45,7 +45,6 @@ public void Generate(IdentityUser user) } _dbContext.SaveChanges(); - } private IEnumerable GetReportJsons() @@ -57,4 +56,4 @@ private IEnumerable GetReportJsons() } } } -} \ No newline at end of file +} diff --git a/AspNet4/Mvc/AdhocReporting/Services/EqSessionCachingService.cs b/AspNet4/Mvc/AdhocReporting/Services/EqSessionCachingService.cs index c2de589d..34951645 100644 --- a/AspNet4/Mvc/AdhocReporting/Services/EqSessionCachingService.cs +++ b/AspNet4/Mvc/AdhocReporting/Services/EqSessionCachingService.cs @@ -1,6 +1,4 @@ -using System; -using System.Web; -using System.Web.SessionState; +using Microsoft.AspNetCore.Http; using Korzh.EasyQuery.Services; @@ -8,24 +6,21 @@ namespace EqDemo.Services { public class EqSessionCachingService : IEqCachingService { - /// - /// An instance of session object - /// - protected readonly HttpSessionState Session; + protected readonly ISession Session; - public EqSessionCachingService() + public EqSessionCachingService(IHttpContextAccessor httpContextAccessor) { - Session = HttpContext.Current.Session; + Session = httpContextAccessor.HttpContext.Session; } public string GetValue(string key) { - return (string)Session[key]; + return Session.GetString(key); } public void PutValue(string key, string value) { - Session[key] = value; + Session.SetString(key, value); } } } diff --git a/AspNet4/Mvc/AdhocReporting/Services/ReportStore.cs b/AspNet4/Mvc/AdhocReporting/Services/ReportStore.cs index 683c3170..00ff2355 100644 --- a/AspNet4/Mvc/AdhocReporting/Services/ReportStore.cs +++ b/AspNet4/Mvc/AdhocReporting/Services/ReportStore.cs @@ -1,17 +1,17 @@ -using System; +using System; +using System.Security.Claims; using System.Security.Principal; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; -using System.Data.Entity; +using System.Threading; -using Microsoft.AspNet.Identity; +using Microsoft.EntityFrameworkCore; using Korzh.EasyQuery; using Korzh.EasyQuery.Services; using EqDemo.Models; -using System.Threading; namespace EqDemo.Services { @@ -35,16 +35,17 @@ public async Task AddQueryAsync(Query query, CancellationToken ct = defaul query.Id = Guid.NewGuid().ToString(); } + var userId = (User?.Identity as ClaimsIdentity)?.FindFirst(ClaimTypes.NameIdentifier)?.Value; + var report = new Report { Id = query.Id, Name = query.Name, Description = query.Description, ModelId = query.Model.Id, QueryJson = await query.SaveToJsonStringAsync(), - OwnerId = User?.Identity.GetUserId() + OwnerId = userId }; - if (report.OwnerId == null) { throw new ArgumentNullException(nameof(report.OwnerId)); } @@ -63,7 +64,6 @@ public async Task> GetAllQueriesAsync(string modelId, return reports.Select(r => new QueryListItem(r.Id, r.ModelId, r.Name, r.Description)).ToList(); } - public async Task LoadQueryAsync(Query query, string queryId, CancellationToken ct = default) { var report = await ApplyUserGuard(DbContext.Reports).FirstOrDefaultAsync(r => r.Id == queryId, ct); @@ -71,10 +71,8 @@ public async Task LoadQueryAsync(Query query, string queryId, Cancellation { await query.LoadFromJsonStringAsync(report.QueryJson, ct); query.Id = report.Id; - return true; } - return false; } @@ -84,10 +82,8 @@ public async Task RemoveQueryAsync(string modelId, string queryId, Cancell if (report != null) { DbContext.Reports.Remove(report); await DbContext.SaveChangesAsync(); - return true; } - return false; } @@ -99,23 +95,20 @@ public async Task SaveQueryAsync(Query query, bool createIfNotExist = true report.Description = query.Description; report.ModelId = query.Model.Id; report.QueryJson = await query.SaveToJsonStringAsync(); - await DbContext.SaveChangesAsync(); - return true; } else if (createIfNotExist) { return await AddQueryAsync(query, ct); } - return false; } private IQueryable ApplyUserGuard(IQueryable filter) { - var userId = User?.Identity.GetUserId(); + var userId = (User?.Identity as ClaimsIdentity)?.FindFirst(ClaimTypes.NameIdentifier)?.Value; return filter.Where(r => r.OwnerId == userId); } } -} \ No newline at end of file +} diff --git a/AspNet4/Mvc/AdhocReporting/Startup.cs b/AspNet4/Mvc/AdhocReporting/Startup.cs index 392d619c..ffa1a32b 100644 --- a/AspNet4/Mvc/AdhocReporting/Startup.cs +++ b/AspNet4/Mvc/AdhocReporting/Startup.cs @@ -1,24 +1,87 @@ -using Microsoft.Owin; -using Owin; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.AspNetCore.Identity; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; -using System.Data.Entity.Migrations; +using Korzh.EasyQuery.Services; +using Korzh.EasyQuery.Db; -using EqDemo.Migrations; +using EqDemo.Models; +using EqDemo.Services; -[assembly: OwinStartupAttribute(typeof(EqDemo.Startup))] namespace EqDemo { - public partial class Startup + public class Startup { - public void Configuration(IAppBuilder app) + public Startup(IConfiguration configuration) { - ConfigureAuth(app); + Configuration = configuration; + DbConnectionString = Configuration.GetConnectionString("DefaultConnection"); + } + + public IConfiguration Configuration { get; } + public string DbConnectionString { get; } + + public void ConfigureServices(IServiceCollection services) + { + services.AddDbContext( + options => options.UseSqlServer(DbConnectionString) + ); + + services.AddIdentity(options => { + options.SignIn.RequireConfirmedAccount = false; + }) + .AddEntityFrameworkStores(); + + services.AddDistributedMemoryCache(); + services.AddSession(); + + services.AddEasyQuery() + .UseSqlManager() + .AddDefaultExporters() + .RegisterDbGate(); + + services.AddControllersWithViews(); + services.AddRazorPages(); + } + + public void Configure(IApplicationBuilder app, IWebHostEnvironment env) + { + if (env.IsDevelopment()) { + app.UseDeveloperExceptionPage(); + } + else { + app.UseExceptionHandler("/Home/Error"); + app.UseHsts(); + } + + app.UseHttpsRedirection(); + app.UseStaticFiles(); + app.UseRouting(); + + app.UseAuthentication(); + app.UseAuthorization(); + app.UseSession(); - var databaseMigrator = new DbMigrator(new Configuration()); - databaseMigrator.Update(); + app.UseEndpoints(endpoints => { + endpoints.MapEasyQuery(options => { + options.DefaultModelId = "adhoc-reporting"; + options.StoreModelInCache = true; + options.StoreQueryInCache = true; + options.SaveNewQuery = true; + options.ConnectionString = DbConnectionString; + options.UseDbContext(); + options.UseQueryStore((_) => new FileQueryStore("App_Data")); + }); - IdentityHelper.SeedEqManagerRole(); - IdentityHelper.SeedDefaultUser(); + endpoints.MapControllerRoute( + name: "default", + pattern: "{controller=Home}/{action=Index}/{id?}"); + endpoints.MapRazorPages(); + }); } } } diff --git a/AspNet4/Mvc/AdhocReporting/Views/Account/ConfirmEmail.cshtml b/AspNet4/Mvc/AdhocReporting/Views/Account/ConfirmEmail.cshtml deleted file mode 100644 index ecbf143b..00000000 --- a/AspNet4/Mvc/AdhocReporting/Views/Account/ConfirmEmail.cshtml +++ /dev/null @@ -1,10 +0,0 @@ -@{ - ViewBag.Title = "Confirm Email"; -} - -

@ViewBag.Title.

-
-

- Thank you for confirming your email. Please @Html.ActionLink("Click here to Log in", "Login", "Account", routeValues: null, htmlAttributes: new { id = "loginLink" }) -

-
diff --git a/AspNet4/Mvc/AdhocReporting/Views/Account/ExternalLoginConfirmation.cshtml b/AspNet4/Mvc/AdhocReporting/Views/Account/ExternalLoginConfirmation.cshtml deleted file mode 100644 index b0de1981..00000000 --- a/AspNet4/Mvc/AdhocReporting/Views/Account/ExternalLoginConfirmation.cshtml +++ /dev/null @@ -1,36 +0,0 @@ -@model EqDemo.Models.ExternalLoginConfirmationViewModel -@{ - ViewBag.Title = "Register"; -} -

@ViewBag.Title.

-

Associate your @ViewBag.LoginProvider account.

- -@using (Html.BeginForm("ExternalLoginConfirmation", "Account", new { ReturnUrl = ViewBag.ReturnUrl }, FormMethod.Post, new { @class = "form-horizontal", role = "form" })) -{ - @Html.AntiForgeryToken() - -

Association Form

-
- @Html.ValidationSummary(true, "", new { @class = "text-danger" }) -

- You've successfully authenticated with @ViewBag.LoginProvider. - Please enter a user name for this site below and click the Register button to finish - logging in. -

-
- @Html.LabelFor(m => m.Email, new { @class = "col-md-2 control-label" }) -
- @Html.TextBoxFor(m => m.Email, new { @class = "form-control" }) - @Html.ValidationMessageFor(m => m.Email, "", new { @class = "text-danger" }) -
-
-
-
- -
-
-} - -@section Scripts { - @Scripts.Render("~/bundles/jqueryval") -} diff --git a/AspNet4/Mvc/AdhocReporting/Views/Account/ExternalLoginFailure.cshtml b/AspNet4/Mvc/AdhocReporting/Views/Account/ExternalLoginFailure.cshtml deleted file mode 100644 index 4ad6a858..00000000 --- a/AspNet4/Mvc/AdhocReporting/Views/Account/ExternalLoginFailure.cshtml +++ /dev/null @@ -1,8 +0,0 @@ -@{ - ViewBag.Title = "Login Failure"; -} - -
-

@ViewBag.Title.

-

Unsuccessful login with service.

-
diff --git a/AspNet4/Mvc/AdhocReporting/Views/Account/ForgotPassword.cshtml b/AspNet4/Mvc/AdhocReporting/Views/Account/ForgotPassword.cshtml deleted file mode 100644 index 8298c2d1..00000000 --- a/AspNet4/Mvc/AdhocReporting/Views/Account/ForgotPassword.cshtml +++ /dev/null @@ -1,29 +0,0 @@ -@model EqDemo.Models.ForgotPasswordViewModel -@{ - ViewBag.Title = "Forgot your password?"; -} - -

@ViewBag.Title.

- -@using (Html.BeginForm("ForgotPassword", "Account", FormMethod.Post, new { @class = "form-horizontal", role = "form" })) -{ - @Html.AntiForgeryToken() -

Enter your email.

-
- @Html.ValidationSummary("", new { @class = "text-danger" }) -
- @Html.LabelFor(m => m.Email, new { @class = "col-md-2 control-label" }) -
- @Html.TextBoxFor(m => m.Email, new { @class = "form-control" }) -
-
-
-
- -
-
-} - -@section Scripts { - @Scripts.Render("~/bundles/jqueryval") -} diff --git a/AspNet4/Mvc/AdhocReporting/Views/Account/ForgotPasswordConfirmation.cshtml b/AspNet4/Mvc/AdhocReporting/Views/Account/ForgotPasswordConfirmation.cshtml deleted file mode 100644 index f48c41b8..00000000 --- a/AspNet4/Mvc/AdhocReporting/Views/Account/ForgotPasswordConfirmation.cshtml +++ /dev/null @@ -1,13 +0,0 @@ -@{ - ViewBag.Title = "Forgot Password Confirmation"; -} - -
-

@ViewBag.Title.

-
-
-

- Please check your email to reset your password. -

-
- diff --git a/AspNet4/Mvc/AdhocReporting/Views/Account/Login.cshtml b/AspNet4/Mvc/AdhocReporting/Views/Account/Login.cshtml deleted file mode 100644 index 7a9aa1dd..00000000 --- a/AspNet4/Mvc/AdhocReporting/Views/Account/Login.cshtml +++ /dev/null @@ -1,87 +0,0 @@ -@using EqDemo.Models -@model LoginViewModel -@{ - ViewBag.Title = "Log in"; - - ViewData["Title"] = "Log in"; - ViewData["MenuTitle"] = "Menu"; - - const string defaultUserEmail = "demo@korzh.com"; - const string defaultUserPassword = "demo"; -} - -
-

@ViewBag.Title.

-
-
-
- @using (Html.BeginForm("Login", "Account", new { ReturnUrl = ViewBag.ReturnUrl }, FormMethod.Post, new { @class = "form-horizontal", role = "form" })) - { - @Html.AntiForgeryToken() -

Use a local account to log in.

-
- @Html.ValidationSummary(true, "", new { @class = "text-danger" }) -
- @Html.LabelFor(m => m.Email, new { @class = "col-md-2 control-label" }) -
- @Html.TextBoxFor(m => m.Email, new { @class = "form-control", @Value = defaultUserEmail }) - @Html.ValidationMessageFor(m => m.Email, "", new { @class = "text-danger" }) -
-
-
- @Html.LabelFor(m => m.Password, new { @class = "col-md-2 control-label" }) -
- @Html.PasswordFor(m => m.Password, new { @class = "form-control", @value = defaultUserPassword }) - @Html.ValidationMessageFor(m => m.Password, "", new { @class = "text-danger" }) -
-
-
-
-
- @Html.CheckBoxFor(m => m.RememberMe) - @Html.LabelFor(m => m.RememberMe) -
-
-
-
-
- -
-
-

- @Html.ActionLink("Register as a new user", "Register", new { ReturnUrl = ViewBag.ReturnUrl }) -

-

- @Html.ActionLink("Forgot your password?", "ForgotPassword") -

- } -
-
-
-
-

Demo account

-
-
-

- Some pages of our demo application require an authorization. - We did that by purpose - to demonstrate how EasyQuery works in the systems with access control. -

- To login you might use the default user with the following credentials: -

-

- login: demo@korzh.com -
- password: demo -

-

- or you can @Html.ActionLink("register a new account", "Register", new { ReturnUrl = ViewBag.ReturnUrl }) and unleash all possibilities of this demo. -

-
-
-
-
-
- -@section Scripts { - @Scripts.Render("~/bundles/jqueryval") -} diff --git a/AspNet4/Mvc/AdhocReporting/Views/Account/Register.cshtml b/AspNet4/Mvc/AdhocReporting/Views/Account/Register.cshtml deleted file mode 100644 index e453f9d1..00000000 --- a/AspNet4/Mvc/AdhocReporting/Views/Account/Register.cshtml +++ /dev/null @@ -1,43 +0,0 @@ -@model EqDemo.Models.RegisterViewModel -@{ - ViewBag.Title = "Register"; -} - -
-

@ViewBag.Title.

- -@using (Html.BeginForm("Register", "Account", new { returnUrl = ViewBag.ReturnUrl }, FormMethod.Post, new { @class = "form-horizontal", role = "form" })) -{ - @Html.AntiForgeryToken() -

Create a new account.

-
- @Html.ValidationSummary("", new { @class = "text-danger" }) -
- @Html.LabelFor(m => m.Email, new { @class = "col-md-2 control-label" }) -
- @Html.TextBoxFor(m => m.Email, new { @class = "form-control" }) -
-
-
- @Html.LabelFor(m => m.Password, new { @class = "col-md-2 control-label" }) -
- @Html.PasswordFor(m => m.Password, new { @class = "form-control" }) -
-
-
- @Html.LabelFor(m => m.ConfirmPassword, new { @class = "col-md-2 control-label" }) -
- @Html.PasswordFor(m => m.ConfirmPassword, new { @class = "form-control" }) -
-
-
-
- -
-
-} -
- -@section Scripts { - @Scripts.Render("~/bundles/jqueryval") -} diff --git a/AspNet4/Mvc/AdhocReporting/Views/Account/ResetPassword.cshtml b/AspNet4/Mvc/AdhocReporting/Views/Account/ResetPassword.cshtml deleted file mode 100644 index 87338427..00000000 --- a/AspNet4/Mvc/AdhocReporting/Views/Account/ResetPassword.cshtml +++ /dev/null @@ -1,42 +0,0 @@ -@model EqDemo.Models.ResetPasswordViewModel -@{ - ViewBag.Title = "Reset password"; -} - -

@ViewBag.Title.

- -@using (Html.BeginForm("ResetPassword", "Account", FormMethod.Post, new { @class = "form-horizontal", role = "form" })) -{ - @Html.AntiForgeryToken() -

Reset your password.

-
- @Html.ValidationSummary("", new { @class = "text-danger" }) - @Html.HiddenFor(model => model.Code) -
- @Html.LabelFor(m => m.Email, new { @class = "col-md-2 control-label" }) -
- @Html.TextBoxFor(m => m.Email, new { @class = "form-control" }) -
-
-
- @Html.LabelFor(m => m.Password, new { @class = "col-md-2 control-label" }) -
- @Html.PasswordFor(m => m.Password, new { @class = "form-control" }) -
-
-
- @Html.LabelFor(m => m.ConfirmPassword, new { @class = "col-md-2 control-label" }) -
- @Html.PasswordFor(m => m.ConfirmPassword, new { @class = "form-control" }) -
-
-
-
- -
-
-} - -@section Scripts { - @Scripts.Render("~/bundles/jqueryval") -} diff --git a/AspNet4/Mvc/AdhocReporting/Views/Account/ResetPasswordConfirmation.cshtml b/AspNet4/Mvc/AdhocReporting/Views/Account/ResetPasswordConfirmation.cshtml deleted file mode 100644 index d8a4b3ba..00000000 --- a/AspNet4/Mvc/AdhocReporting/Views/Account/ResetPasswordConfirmation.cshtml +++ /dev/null @@ -1,12 +0,0 @@ -@{ - ViewBag.Title = "Reset password confirmation"; -} - -
-

@ViewBag.Title.

-
-
-

- Your password has been reset. Please @Html.ActionLink("click here to log in", "Login", "Account", routeValues: null, htmlAttributes: new { id = "loginLink" }) -

-
diff --git a/AspNet4/Mvc/AdhocReporting/Views/Account/SendCode.cshtml b/AspNet4/Mvc/AdhocReporting/Views/Account/SendCode.cshtml deleted file mode 100644 index 0680d7c4..00000000 --- a/AspNet4/Mvc/AdhocReporting/Views/Account/SendCode.cshtml +++ /dev/null @@ -1,24 +0,0 @@ -@model EqDemo.Models.SendCodeViewModel -@{ - ViewBag.Title = "Send"; -} - -

@ViewBag.Title.

- -@using (Html.BeginForm("SendCode", "Account", new { ReturnUrl = Model.ReturnUrl }, FormMethod.Post, new { @class = "form-horizontal", role = "form" })) { - @Html.AntiForgeryToken() - @Html.Hidden("rememberMe", @Model.RememberMe) -

Send verification code

-
-
-
- Select Two-Factor Authentication Provider: - @Html.DropDownListFor(model => model.SelectedProvider, Model.Providers) - -
-
-} - -@section Scripts { - @Scripts.Render("~/bundles/jqueryval") -} diff --git a/AspNet4/Mvc/AdhocReporting/Views/Account/VerifyCode.cshtml b/AspNet4/Mvc/AdhocReporting/Views/Account/VerifyCode.cshtml deleted file mode 100644 index a4f659fc..00000000 --- a/AspNet4/Mvc/AdhocReporting/Views/Account/VerifyCode.cshtml +++ /dev/null @@ -1,38 +0,0 @@ -@model EqDemo.Models.VerifyCodeViewModel -@{ - ViewBag.Title = "Verify"; -} - -

@ViewBag.Title.

- -@using (Html.BeginForm("VerifyCode", "Account", new { ReturnUrl = Model.ReturnUrl }, FormMethod.Post, new { @class = "form-horizontal", role = "form" })) { - @Html.AntiForgeryToken() - @Html.Hidden("provider", @Model.Provider) - @Html.Hidden("rememberMe", @Model.RememberMe) -

Enter verification code

-
- @Html.ValidationSummary("", new { @class = "text-danger" }) -
- @Html.LabelFor(m => m.Code, new { @class = "col-md-2 control-label" }) -
- @Html.TextBoxFor(m => m.Code, new { @class = "form-control" }) -
-
-
-
-
- @Html.CheckBoxFor(m => m.RememberBrowser) - @Html.LabelFor(m => m.RememberBrowser) -
-
-
-
-
- -
-
-} - -@section Scripts { - @Scripts.Render("~/bundles/jqueryval") -} diff --git a/AspNet4/Mvc/AdhocReporting/Views/Account/_ExternalLoginsListPartial.cshtml b/AspNet4/Mvc/AdhocReporting/Views/Account/_ExternalLoginsListPartial.cshtml deleted file mode 100644 index e9200032..00000000 --- a/AspNet4/Mvc/AdhocReporting/Views/Account/_ExternalLoginsListPartial.cshtml +++ /dev/null @@ -1,28 +0,0 @@ -@model EqDemo.Models.ExternalLoginListViewModel -@using Microsoft.Owin.Security - -

Use another service to log in.

-
-@{ - var loginProviders = Context.GetOwinContext().Authentication.GetExternalAuthenticationTypes(); - if (loginProviders.Count() == 0) { -
-

- There are no external authentication services configured. See this article - for details on setting up this ASP.NET application to support logging in via external services. -

-
- } - else { - using (Html.BeginForm("ExternalLogin", "Account", new { ReturnUrl = Model.ReturnUrl })) { - @Html.AntiForgeryToken() -
-

- @foreach (AuthenticationDescription p in loginProviders) { - - } -

-
- } - } -} diff --git a/AspNet4/Mvc/AdhocReporting/Views/Manage/AddPhoneNumber.cshtml b/AspNet4/Mvc/AdhocReporting/Views/Manage/AddPhoneNumber.cshtml deleted file mode 100644 index 6a5613ed..00000000 --- a/AspNet4/Mvc/AdhocReporting/Views/Manage/AddPhoneNumber.cshtml +++ /dev/null @@ -1,29 +0,0 @@ -@model EqDemo.Models.AddPhoneNumberViewModel -@{ - ViewBag.Title = "Phone Number"; -} - -

@ViewBag.Title.

- -@using (Html.BeginForm("AddPhoneNumber", "Manage", FormMethod.Post, new { @class = "form-horizontal", role = "form" })) -{ - @Html.AntiForgeryToken() -

Add a phone number

-
- @Html.ValidationSummary("", new { @class = "text-danger" }) -
- @Html.LabelFor(m => m.Number, new { @class = "col-md-2 control-label" }) -
- @Html.TextBoxFor(m => m.Number, new { @class = "form-control" }) -
-
-
-
- -
-
-} - -@section Scripts { - @Scripts.Render("~/bundles/jqueryval") -} diff --git a/AspNet4/Mvc/AdhocReporting/Views/Manage/ChangePassword.cshtml b/AspNet4/Mvc/AdhocReporting/Views/Manage/ChangePassword.cshtml deleted file mode 100644 index eb272cb9..00000000 --- a/AspNet4/Mvc/AdhocReporting/Views/Manage/ChangePassword.cshtml +++ /dev/null @@ -1,40 +0,0 @@ -@model EqDemo.Models.ChangePasswordViewModel -@{ - ViewBag.Title = "Change Password"; -} - -

@ViewBag.Title.

- -@using (Html.BeginForm("ChangePassword", "Manage", FormMethod.Post, new { @class = "form-horizontal", role = "form" })) -{ - @Html.AntiForgeryToken() -

Change Password Form

-
- @Html.ValidationSummary("", new { @class = "text-danger" }) -
- @Html.LabelFor(m => m.OldPassword, new { @class = "col-md-2 control-label" }) -
- @Html.PasswordFor(m => m.OldPassword, new { @class = "form-control" }) -
-
-
- @Html.LabelFor(m => m.NewPassword, new { @class = "col-md-2 control-label" }) -
- @Html.PasswordFor(m => m.NewPassword, new { @class = "form-control" }) -
-
-
- @Html.LabelFor(m => m.ConfirmPassword, new { @class = "col-md-2 control-label" }) -
- @Html.PasswordFor(m => m.ConfirmPassword, new { @class = "form-control" }) -
-
-
-
- -
-
-} -@section Scripts { - @Scripts.Render("~/bundles/jqueryval") -} diff --git a/AspNet4/Mvc/AdhocReporting/Views/Manage/Index.cshtml b/AspNet4/Mvc/AdhocReporting/Views/Manage/Index.cshtml deleted file mode 100644 index 01edf4f2..00000000 --- a/AspNet4/Mvc/AdhocReporting/Views/Manage/Index.cshtml +++ /dev/null @@ -1,87 +0,0 @@ -@model EqDemo.Models.IndexViewModel -@{ - ViewBag.Title = "Manage"; -} - -

@ViewBag.Title.

- -

@ViewBag.StatusMessage

-
-

Change your account settings

-
-
-
Password:
-
- [ - @if (Model.HasPassword) - { - @Html.ActionLink("Change your password", "ChangePassword") - } - else - { - @Html.ActionLink("Create", "SetPassword") - } - ] -
-
External Logins:
-
- @Model.Logins.Count [ - @Html.ActionLink("Manage", "ManageLogins") ] -
- @* - Phone Numbers can used as a second factor of verification in a two-factor authentication system. - - See this article - for details on setting up this ASP.NET application to support two-factor authentication using SMS. - - Uncomment the following block after you have set up two-factor authentication - *@ - @* -
Phone Number:
-
- @(Model.PhoneNumber ?? "None") - @if (Model.PhoneNumber != null) - { -
- [  @Html.ActionLink("Change", "AddPhoneNumber")  ] - using (Html.BeginForm("RemovePhoneNumber", "Manage", FormMethod.Post, new { @class = "form-horizontal", role = "form" })) - { - @Html.AntiForgeryToken() - [] - } - } - else - { - [  @Html.ActionLink("Add", "AddPhoneNumber") - } -
- *@ -
Two-Factor Authentication:
-
-

- There are no two-factor authentication providers configured. See this article - for details on setting up this ASP.NET application to support two-factor authentication. -

- @*@if (Model.TwoFactor) - { - using (Html.BeginForm("DisableTwoFactorAuthentication", "Manage", FormMethod.Post, new { @class = "form-horizontal", role = "form" })) - { - @Html.AntiForgeryToken() - Enabled - - - } - } - else - { - using (Html.BeginForm("EnableTwoFactorAuthentication", "Manage", FormMethod.Post, new { @class = "form-horizontal", role = "form" })) - { - @Html.AntiForgeryToken() - Disabled - - - } - }*@ -
-
-
diff --git a/AspNet4/Mvc/AdhocReporting/Views/Manage/ManageLogins.cshtml b/AspNet4/Mvc/AdhocReporting/Views/Manage/ManageLogins.cshtml deleted file mode 100644 index 592228d4..00000000 --- a/AspNet4/Mvc/AdhocReporting/Views/Manage/ManageLogins.cshtml +++ /dev/null @@ -1,70 +0,0 @@ -@model EqDemo.Models.ManageLoginsViewModel -@using Microsoft.Owin.Security -@{ - ViewBag.Title = "Manage your external logins"; -} - -

@ViewBag.Title.

- -

@ViewBag.StatusMessage

-@{ - var loginProviders = Context.GetOwinContext().Authentication.GetExternalAuthenticationTypes(); - if (loginProviders.Count() == 0) { -
-

- There are no external authentication services configured. See this article - for details on setting up this ASP.NET application to support logging in via external services. -

-
- } - else - { - if (Model.CurrentLogins.Count > 0) - { -

Registered Logins

- - - @foreach (var account in Model.CurrentLogins) - { - - - - - } - -
@account.LoginProvider - @if (ViewBag.ShowRemoveButton) - { - using (Html.BeginForm("RemoveLogin", "Manage")) - { - @Html.AntiForgeryToken() -
- @Html.Hidden("loginProvider", account.LoginProvider) - @Html.Hidden("providerKey", account.ProviderKey) - -
- } - } - else - { - @:   - } -
- } - if (Model.OtherLogins.Count > 0) - { - using (Html.BeginForm("LinkLogin", "Manage")) - { - @Html.AntiForgeryToken() -
-

- @foreach (AuthenticationDescription p in Model.OtherLogins) - { - - } -

-
- } - } - } -} diff --git a/AspNet4/Mvc/AdhocReporting/Views/Manage/SetPassword.cshtml b/AspNet4/Mvc/AdhocReporting/Views/Manage/SetPassword.cshtml deleted file mode 100644 index e61789be..00000000 --- a/AspNet4/Mvc/AdhocReporting/Views/Manage/SetPassword.cshtml +++ /dev/null @@ -1,39 +0,0 @@ -@model EqDemo.Models.SetPasswordViewModel -@{ - ViewBag.Title = "Create Password"; -} - -

@ViewBag.Title.

-

- You do not have a local username/password for this site. Add a local - account so you can log in without an external login. -

- -@using (Html.BeginForm("SetPassword", "Manage", FormMethod.Post, new { @class = "form-horizontal", role = "form" })) -{ - @Html.AntiForgeryToken() - -

Create Local Login

-
- @Html.ValidationSummary("", new { @class = "text-danger" }) -
- @Html.LabelFor(m => m.NewPassword, new { @class = "col-md-2 control-label" }) -
- @Html.PasswordFor(m => m.NewPassword, new { @class = "form-control" }) -
-
-
- @Html.LabelFor(m => m.ConfirmPassword, new { @class = "col-md-2 control-label" }) -
- @Html.PasswordFor(m => m.ConfirmPassword, new { @class = "form-control" }) -
-
-
-
- -
-
-} -@section Scripts { - @Scripts.Render("~/bundles/jqueryval") -} diff --git a/AspNet4/Mvc/AdhocReporting/Views/Manage/VerifyPhoneNumber.cshtml b/AspNet4/Mvc/AdhocReporting/Views/Manage/VerifyPhoneNumber.cshtml deleted file mode 100644 index 09d09c32..00000000 --- a/AspNet4/Mvc/AdhocReporting/Views/Manage/VerifyPhoneNumber.cshtml +++ /dev/null @@ -1,31 +0,0 @@ -@model EqDemo.Models.VerifyPhoneNumberViewModel -@{ - ViewBag.Title = "Verify Phone Number"; -} - -

@ViewBag.Title.

- -@using (Html.BeginForm("VerifyPhoneNumber", "Manage", FormMethod.Post, new { @class = "form-horizontal", role = "form" })) -{ - @Html.AntiForgeryToken() - @Html.Hidden("phoneNumber", @Model.PhoneNumber) -

Enter verification code

-
@ViewBag.Status
-
- @Html.ValidationSummary("", new { @class = "text-danger" }) -
- @Html.LabelFor(m => m.Code, new { @class = "col-md-2 control-label" }) -
- @Html.TextBoxFor(m => m.Code, new { @class = "form-control" }) -
-
-
-
- -
-
-} - -@section Scripts { - @Scripts.Render("~/bundles/jqueryval") -} diff --git a/AspNet4/Mvc/AdhocReporting/Views/Shared/Error.cshtml b/AspNet4/Mvc/AdhocReporting/Views/Shared/Error.cshtml index 228b287f..b19d5537 100644 --- a/AspNet4/Mvc/AdhocReporting/Views/Shared/Error.cshtml +++ b/AspNet4/Mvc/AdhocReporting/Views/Shared/Error.cshtml @@ -1,9 +1,4 @@ -@model System.Web.Mvc.HandleErrorInfo - -@{ - ViewBag.Title = "Error"; -} +@{ ViewBag.Title = "Error"; }

Error.

An error occurred while processing your request.

- diff --git a/AspNet4/Mvc/AdhocReporting/Views/Shared/Lockout.cshtml b/AspNet4/Mvc/AdhocReporting/Views/Shared/Lockout.cshtml deleted file mode 100644 index e6e33ad7..00000000 --- a/AspNet4/Mvc/AdhocReporting/Views/Shared/Lockout.cshtml +++ /dev/null @@ -1,10 +0,0 @@ -@model System.Web.Mvc.HandleErrorInfo - -@{ - ViewBag.Title = "Locked Out"; -} - -
-

Locked out.

-

This account has been locked out, please try again later.

-
diff --git a/AspNet4/Mvc/AdhocReporting/Views/Shared/_LoginPartial.cshtml b/AspNet4/Mvc/AdhocReporting/Views/Shared/_LoginPartial.cshtml deleted file mode 100644 index c0f794e6..00000000 --- a/AspNet4/Mvc/AdhocReporting/Views/Shared/_LoginPartial.cshtml +++ /dev/null @@ -1,31 +0,0 @@ -@using Microsoft.AspNet.Identity - - diff --git a/AspNet4/Mvc/AdhocReporting/Views/Web.config b/AspNet4/Mvc/AdhocReporting/Views/Web.config deleted file mode 100644 index 83991b1c..00000000 --- a/AspNet4/Mvc/AdhocReporting/Views/Web.config +++ /dev/null @@ -1,51 +0,0 @@ - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/AspNet4/Mvc/AdhocReporting/Web.Debug.config b/AspNet4/Mvc/AdhocReporting/Web.Debug.config deleted file mode 100644 index d7712aaf..00000000 --- a/AspNet4/Mvc/AdhocReporting/Web.Debug.config +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - diff --git a/AspNet4/Mvc/AdhocReporting/Web.Release.config b/AspNet4/Mvc/AdhocReporting/Web.Release.config deleted file mode 100644 index 28a4d5fc..00000000 --- a/AspNet4/Mvc/AdhocReporting/Web.Release.config +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - diff --git a/AspNet4/Mvc/AdhocReporting/Web.config b/AspNet4/Mvc/AdhocReporting/Web.config deleted file mode 100644 index 1911a503..00000000 --- a/AspNet4/Mvc/AdhocReporting/Web.config +++ /dev/null @@ -1,348 +0,0 @@ - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/AspNet4/Mvc/AdhocReporting/appsettings.json b/AspNet4/Mvc/AdhocReporting/appsettings.json new file mode 100644 index 00000000..0c8fea7d --- /dev/null +++ b/AspNet4/Mvc/AdhocReporting/appsettings.json @@ -0,0 +1,14 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Warning" + } + }, + "AllowedHosts": "*", + "ConnectionStrings": { + "DefaultConnection": "Data Source=(localdb)\\MSSQLLocalDB;Initial Catalog=EqDemo.AspNet4x.AdhocReporting;Integrated Security=True;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False" + }, + "EasyQuery": { + "LicenseKey": "" + } +} diff --git a/AspNet4/Mvc/AdhocReportingMetaData/App_Start/BundleConfig.cs b/AspNet4/Mvc/AdhocReportingMetaData/App_Start/BundleConfig.cs deleted file mode 100644 index 4ab56283..00000000 --- a/AspNet4/Mvc/AdhocReportingMetaData/App_Start/BundleConfig.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Web; -using System.Web.Optimization; - -namespace EqDemo -{ - public class BundleConfig - { - // For more information on bundling, visit https://go.microsoft.com/fwlink/?LinkId=301862 - public static void RegisterBundles(BundleCollection bundles) - { - } - } -} diff --git a/AspNet4/Mvc/AdhocReportingMetaData/App_Start/FilterConfig.cs b/AspNet4/Mvc/AdhocReportingMetaData/App_Start/FilterConfig.cs deleted file mode 100644 index 4dc97cb5..00000000 --- a/AspNet4/Mvc/AdhocReportingMetaData/App_Start/FilterConfig.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Web; -using System.Web.Mvc; - -namespace EqDemo -{ - public class FilterConfig - { - public static void RegisterGlobalFilters(GlobalFilterCollection filters) - { - filters.Add(new HandleErrorAttribute()); - } - } -} diff --git a/AspNet4/Mvc/AdhocReportingMetaData/App_Start/IdentityConfig.cs b/AspNet4/Mvc/AdhocReportingMetaData/App_Start/IdentityConfig.cs deleted file mode 100644 index 13e3f6a2..00000000 --- a/AspNet4/Mvc/AdhocReportingMetaData/App_Start/IdentityConfig.cs +++ /dev/null @@ -1,109 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Data.Entity; -using System.Linq; -using System.Security.Claims; -using System.Threading.Tasks; -using System.Web; -using Microsoft.AspNet.Identity; -using Microsoft.AspNet.Identity.EntityFramework; -using Microsoft.AspNet.Identity.Owin; -using Microsoft.Owin; -using Microsoft.Owin.Security; -using EqDemo.Models; - -namespace EqDemo -{ - public class EmailService : IIdentityMessageService - { - public Task SendAsync(IdentityMessage message) - { - // Plug in your email service here to send an email. - return Task.FromResult(0); - } - } - - public class SmsService : IIdentityMessageService - { - public Task SendAsync(IdentityMessage message) - { - // Plug in your SMS service here to send a text message. - return Task.FromResult(0); - } - } - - // Configure the application user manager used in this application. UserManager is defined in ASP.NET Identity and is used by the application. - public class ApplicationUserManager : UserManager - { - public ApplicationUserManager(IUserStore store) - : base(store) - { - } - - public static ApplicationUserManager Create(IdentityFactoryOptions options, IOwinContext context) - { - var manager = new ApplicationUserManager(new UserStore(context.Get())); - // Configure validation logic for usernames - manager.UserValidator = new UserValidator(manager) - { - AllowOnlyAlphanumericUserNames = false, - RequireUniqueEmail = true - }; - - // Configure validation logic for passwords - manager.PasswordValidator = new PasswordValidator - { - RequiredLength = 4, - RequireNonLetterOrDigit = false, - RequireDigit = false, - RequireLowercase = false, - RequireUppercase = false, - }; - - // Configure user lockout defaults - manager.UserLockoutEnabledByDefault = true; - manager.DefaultAccountLockoutTimeSpan = TimeSpan.FromMinutes(5); - manager.MaxFailedAccessAttemptsBeforeLockout = 5; - - // Register two factor authentication providers. This application uses Phone and Emails as a step of receiving a code for verifying the user - // You can write your own provider and plug it in here. - manager.RegisterTwoFactorProvider("Phone Code", new PhoneNumberTokenProvider - { - MessageFormat = "Your security code is {0}" - }); - manager.RegisterTwoFactorProvider("Email Code", new EmailTokenProvider - { - Subject = "Security Code", - BodyFormat = "Your security code is {0}" - }); - manager.EmailService = new EmailService(); - manager.SmsService = new SmsService(); - var dataProtectionProvider = options.DataProtectionProvider; - if (dataProtectionProvider != null) - { - manager.UserTokenProvider = - new DataProtectorTokenProvider(dataProtectionProvider.Create("ASP.NET Identity")); - } - return manager; - } - } - - // Configure the application sign-in manager which is used in this application. - public class ApplicationSignInManager : SignInManager - { - public ApplicationSignInManager(ApplicationUserManager userManager, IAuthenticationManager authenticationManager) - : base(userManager, authenticationManager) - { - } - - public override Task CreateUserIdentityAsync(ApplicationUser user) - { - return user.GenerateUserIdentityAsync((ApplicationUserManager)UserManager); - } - - public static ApplicationSignInManager Create(IdentityFactoryOptions options, IOwinContext context) - { - return new ApplicationSignInManager(context.GetUserManager(), context.Authentication); - } - } -} diff --git a/AspNet4/Mvc/AdhocReportingMetaData/App_Start/RouteConfig.cs b/AspNet4/Mvc/AdhocReportingMetaData/App_Start/RouteConfig.cs deleted file mode 100644 index a6ba8187..00000000 --- a/AspNet4/Mvc/AdhocReportingMetaData/App_Start/RouteConfig.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web; -using System.Web.Mvc; -using System.Web.Routing; - -namespace EqDemo -{ - public class RouteConfig - { - public static void RegisterRoutes(RouteCollection routes) - { - routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); - - routes.MapMvcAttributeRoutes(); - - routes.MapRoute( - name: "Default", - url: "{controller}/{action}/{id}", - defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional } - ); - } - } -} diff --git a/AspNet4/Mvc/AdhocReportingMetaData/App_Start/Startup.Auth.cs b/AspNet4/Mvc/AdhocReportingMetaData/App_Start/Startup.Auth.cs deleted file mode 100644 index 391f3392..00000000 --- a/AspNet4/Mvc/AdhocReportingMetaData/App_Start/Startup.Auth.cs +++ /dev/null @@ -1,84 +0,0 @@ -using System; -using System.Web; -using Microsoft.AspNet.Identity; -using Microsoft.AspNet.Identity.Owin; -using Microsoft.Owin; -using Microsoft.Owin.Security.Cookies; -using Microsoft.Owin.Security.Google; -using Owin; -using EqDemo.Models; - -namespace EqDemo -{ - public partial class Startup - { - // For more information on configuring authentication, please visit https://go.microsoft.com/fwlink/?LinkId=301864 - public void ConfigureAuth(IAppBuilder app) - { - // Configure the db context, user manager and signin manager to use a single instance per request - app.CreatePerOwinContext(ApplicationDbContext.Create); - app.CreatePerOwinContext(ApplicationUserManager.Create); - app.CreatePerOwinContext(ApplicationSignInManager.Create); - - // Enable the application to use a cookie to store information for the signed in user - // and to use a cookie to temporarily store information about a user logging in with a third party login provider - // Configure the sign in cookie - app.UseCookieAuthentication(new CookieAuthenticationOptions - { - AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie, - LoginPath = new PathString("/Account/Login"), - Provider = new CookieAuthenticationProvider - { - // Enables the application to validate the security stamp when the user logs in. - // This is a security feature which is used when you change a password or add an external login to your account. - OnValidateIdentity = SecurityStampValidator.OnValidateIdentity( - validateInterval: TimeSpan.FromMinutes(30), - regenerateIdentity: (manager, user) => user.GenerateUserIdentityAsync(manager)), - - // This code is needed to forbid reditrect for api methods - // when user is unauthorized - OnApplyRedirect = ctx => { - - if (!IsApiRequest(ctx.Request)) { - ctx.Response.Redirect(ctx.RedirectUri); - } - } - } - }); - app.UseExternalSignInCookie(DefaultAuthenticationTypes.ExternalCookie); - - // Enables the application to temporarily store user information when they are verifying the second factor in the two-factor authentication process. - app.UseTwoFactorSignInCookie(DefaultAuthenticationTypes.TwoFactorCookie, TimeSpan.FromMinutes(5)); - - // Enables the application to remember the second login verification factor such as phone or email. - // Once you check this option, your second step of verification during the login process will be remembered on the device where you logged in from. - // This is similar to the RememberMe option when you log in. - app.UseTwoFactorRememberBrowserCookie(DefaultAuthenticationTypes.TwoFactorRememberBrowserCookie); - - // Uncomment the following lines to enable logging in with third party login providers - //app.UseMicrosoftAccountAuthentication( - // clientId: "", - // clientSecret: ""); - - //app.UseTwitterAuthentication( - // consumerKey: "", - // consumerSecret: ""); - - //app.UseFacebookAuthentication( - // appId: "", - // appSecret: ""); - - //app.UseGoogleAuthentication(new GoogleOAuth2AuthenticationOptions() - //{ - // ClientId = "", - // ClientSecret = "" - //}); - } - - private static bool IsApiRequest(IOwinRequest request) - { - string apiPath = VirtualPathUtility.ToAbsolute("~/api/"); - return request.Uri.LocalPath.StartsWith(apiPath); - } - } -} \ No newline at end of file diff --git a/AspNet4/Mvc/AdhocReportingMetaData/App_Start/WebApiConfig.cs b/AspNet4/Mvc/AdhocReportingMetaData/App_Start/WebApiConfig.cs deleted file mode 100644 index 4225fedb..00000000 --- a/AspNet4/Mvc/AdhocReportingMetaData/App_Start/WebApiConfig.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Web.Http; -using System.Web.Http.Controllers; -using System.Web.Http.Routing; -using Korzh.EasyQuery.Services; - -using EasyData.Export; -using Korzh.EasyQuery.AspNet; - -namespace EqDemo -{ - public static class WebApiConfig - { - public static void Register(HttpConfiguration config) - { - // Web API configuration and services - - // Web API routes - config.MapHttpAttributeRoutesWithEasyQuery(); - - config.Routes.MapHttpRoute( - name: "DefaultApi", - routeTemplate: "api/{controller}/{id}", - defaults: new { id = RouteParameter.Optional } - ); - - // Register you exportes here - // to make export works - EasyQueryManager.RegisterExporter("csv", new CsvDataExporter()); - EasyQueryManager.RegisterExporter("excel", new ExcelDataExporter()); - EasyQueryManager.RegisterExporter("excel-html", new ExcelHtmlDataExporter()); - EasyQueryManager.RegisterExporter("pdf", new PdfDataExporter()); - - // Uncomment this line to enable model loading from DbConnection - EasyQueryManagerSql.RegisterDbGate(); - } - } -} diff --git a/AspNet4/Mvc/AdhocReportingMetaData/Controllers/AccountController.cs b/AspNet4/Mvc/AdhocReportingMetaData/Controllers/AccountController.cs deleted file mode 100644 index 7773d4d2..00000000 --- a/AspNet4/Mvc/AdhocReportingMetaData/Controllers/AccountController.cs +++ /dev/null @@ -1,497 +0,0 @@ -using System; -using System.Globalization; -using System.Linq; -using System.Security.Claims; -using System.Threading.Tasks; -using System.Web; -using System.Web.Mvc; -using Microsoft.AspNet.Identity; -using Microsoft.AspNet.Identity.Owin; -using Microsoft.Owin.Security; - -using EqDemo.Models; -using EqDemo.Services; - -namespace EqDemo.Controllers -{ - [Authorize] - public class AccountController : Controller - { - private ApplicationSignInManager _signInManager; - private ApplicationUserManager _userManager; - - private DefaultReportGenerator _reportGenerator; - - public AccountController() - { - _reportGenerator = new DefaultReportGenerator(ApplicationDbContext.Create()); - } - - public AccountController(ApplicationUserManager userManager, ApplicationSignInManager signInManager): this() - { - UserManager = userManager; - SignInManager = signInManager; - } - - public ApplicationSignInManager SignInManager - { - get - { - return _signInManager ?? HttpContext.GetOwinContext().Get(); - } - private set - { - _signInManager = value; - } - } - - public ApplicationUserManager UserManager - { - get - { - return _userManager ?? HttpContext.GetOwinContext().GetUserManager(); - } - private set - { - _userManager = value; - } - } - - // - // GET: /Account/Login - [AllowAnonymous] - public ActionResult Login(string returnUrl) - { - ViewBag.ReturnUrl = returnUrl; - return View(); - } - - // - // POST: /Account/Login - [HttpPost] - [AllowAnonymous] - [ValidateAntiForgeryToken] - public async Task Login(LoginViewModel model, string returnUrl) - { - if (!ModelState.IsValid) - { - return View(model); - } - - // This doesn't count login failures towards account lockout - // To enable password failures to trigger account lockout, change to shouldLockout: true - var result = await SignInManager.PasswordSignInAsync(model.Email, model.Password, model.RememberMe, shouldLockout: false); - switch (result) - { - case SignInStatus.Success: - return RedirectToLocal(returnUrl); - case SignInStatus.LockedOut: - return View("Lockout"); - case SignInStatus.RequiresVerification: - return RedirectToAction("SendCode", new { ReturnUrl = returnUrl, RememberMe = model.RememberMe }); - case SignInStatus.Failure: - default: - ViewBag.ReturnUrl = returnUrl; - ModelState.AddModelError("", "Invalid login attempt."); - return View(model); - } - } - - // - // GET: /Account/VerifyCode - [AllowAnonymous] - public async Task VerifyCode(string provider, string returnUrl, bool rememberMe) - { - // Require that the user has already logged in via username/password or external login - if (!await SignInManager.HasBeenVerifiedAsync()) - { - return View("Error"); - } - return View(new VerifyCodeViewModel { Provider = provider, ReturnUrl = returnUrl, RememberMe = rememberMe }); - } - - // - // POST: /Account/VerifyCode - [HttpPost] - [AllowAnonymous] - [ValidateAntiForgeryToken] - public async Task VerifyCode(VerifyCodeViewModel model) - { - if (!ModelState.IsValid) - { - return View(model); - } - - // The following code protects for brute force attacks against the two factor codes. - // If a user enters incorrect codes for a specified amount of time then the user account - // will be locked out for a specified amount of time. - // You can configure the account lockout settings in IdentityConfig - var result = await SignInManager.TwoFactorSignInAsync(model.Provider, model.Code, isPersistent: model.RememberMe, rememberBrowser: model.RememberBrowser); - switch (result) - { - case SignInStatus.Success: - return RedirectToLocal(model.ReturnUrl); - case SignInStatus.LockedOut: - return View("Lockout"); - case SignInStatus.Failure: - default: - ModelState.AddModelError("", "Invalid code."); - return View(model); - } - } - - // - // GET: /Account/Register - [AllowAnonymous] - public ActionResult Register(string returnUrl) - { - ViewBag.ReturnUrl = returnUrl; - return View(); - } - - // - // POST: /Account/Register - [HttpPost] - [AllowAnonymous] - [ValidateAntiForgeryToken] - public async Task Register(RegisterViewModel model, string returnUrl) - { - if (ModelState.IsValid) - { - var user = new ApplicationUser { UserName = model.Email, Email = model.Email }; - var result = await UserManager.CreateAsync(user, model.Password); - if (result.Succeeded) - { - await UserManager.AddToRoleAsync(user.Id, "eq-manager"); - await SignInManager.SignInAsync(user, isPersistent:false, rememberBrowser:false); - - _reportGenerator.Generate(user); - - // For more information on how to enable account confirmation and password reset please visit https://go.microsoft.com/fwlink/?LinkID=320771 - // Send an email with this link - // string code = await UserManager.GenerateEmailConfirmationTokenAsync(user.Id); - // var callbackUrl = Url.Action("ConfirmEmail", "Account", new { userId = user.Id, code = code }, protocol: Request.Url.Scheme); - // await UserManager.SendEmailAsync(user.Id, "Confirm your account", "Please confirm your account by clicking here"); - - return RedirectToLocal(returnUrl); - } - AddErrors(result); - } - - ViewBag.ReturnUrl = returnUrl; - - // If we got this far, something failed, redisplay form - return View(model); - } - - // - // GET: /Account/ConfirmEmail - [AllowAnonymous] - public async Task ConfirmEmail(string userId, string code) - { - if (userId == null || code == null) - { - return View("Error"); - } - var result = await UserManager.ConfirmEmailAsync(userId, code); - return View(result.Succeeded ? "ConfirmEmail" : "Error"); - } - - // - // GET: /Account/ForgotPassword - [AllowAnonymous] - public ActionResult ForgotPassword() - { - return View(); - } - - // - // POST: /Account/ForgotPassword - [HttpPost] - [AllowAnonymous] - [ValidateAntiForgeryToken] - public async Task ForgotPassword(ForgotPasswordViewModel model) - { - if (ModelState.IsValid) - { - var user = await UserManager.FindByNameAsync(model.Email); - if (user == null || !(await UserManager.IsEmailConfirmedAsync(user.Id))) - { - // Don't reveal that the user does not exist or is not confirmed - return View("ForgotPasswordConfirmation"); - } - - // For more information on how to enable account confirmation and password reset please visit https://go.microsoft.com/fwlink/?LinkID=320771 - // Send an email with this link - // string code = await UserManager.GeneratePasswordResetTokenAsync(user.Id); - // var callbackUrl = Url.Action("ResetPassword", "Account", new { userId = user.Id, code = code }, protocol: Request.Url.Scheme); - // await UserManager.SendEmailAsync(user.Id, "Reset Password", "Please reset your password by clicking here"); - // return RedirectToAction("ForgotPasswordConfirmation", "Account"); - } - - // If we got this far, something failed, redisplay form - return View(model); - } - - // - // GET: /Account/ForgotPasswordConfirmation - [AllowAnonymous] - public ActionResult ForgotPasswordConfirmation() - { - return View(); - } - - // - // GET: /Account/ResetPassword - [AllowAnonymous] - public ActionResult ResetPassword(string code) - { - return code == null ? View("Error") : View(); - } - - // - // POST: /Account/ResetPassword - [HttpPost] - [AllowAnonymous] - [ValidateAntiForgeryToken] - public async Task ResetPassword(ResetPasswordViewModel model) - { - if (!ModelState.IsValid) - { - return View(model); - } - var user = await UserManager.FindByNameAsync(model.Email); - if (user == null) - { - // Don't reveal that the user does not exist - return RedirectToAction("ResetPasswordConfirmation", "Account"); - } - var result = await UserManager.ResetPasswordAsync(user.Id, model.Code, model.Password); - if (result.Succeeded) - { - return RedirectToAction("ResetPasswordConfirmation", "Account"); - } - AddErrors(result); - return View(); - } - - // - // GET: /Account/ResetPasswordConfirmation - [AllowAnonymous] - public ActionResult ResetPasswordConfirmation() - { - return View(); - } - - // - // POST: /Account/ExternalLogin - [HttpPost] - [AllowAnonymous] - [ValidateAntiForgeryToken] - public ActionResult ExternalLogin(string provider, string returnUrl) - { - // Request a redirect to the external login provider - return new ChallengeResult(provider, Url.Action("ExternalLoginCallback", "Account", new { ReturnUrl = returnUrl })); - } - - // - // GET: /Account/SendCode - [AllowAnonymous] - public async Task SendCode(string returnUrl, bool rememberMe) - { - var userId = await SignInManager.GetVerifiedUserIdAsync(); - if (userId == null) - { - return View("Error"); - } - var userFactors = await UserManager.GetValidTwoFactorProvidersAsync(userId); - var factorOptions = userFactors.Select(purpose => new SelectListItem { Text = purpose, Value = purpose }).ToList(); - return View(new SendCodeViewModel { Providers = factorOptions, ReturnUrl = returnUrl, RememberMe = rememberMe }); - } - - // - // POST: /Account/SendCode - [HttpPost] - [AllowAnonymous] - [ValidateAntiForgeryToken] - public async Task SendCode(SendCodeViewModel model) - { - if (!ModelState.IsValid) - { - return View(); - } - - // Generate the token and send it - if (!await SignInManager.SendTwoFactorCodeAsync(model.SelectedProvider)) - { - return View("Error"); - } - return RedirectToAction("VerifyCode", new { Provider = model.SelectedProvider, ReturnUrl = model.ReturnUrl, RememberMe = model.RememberMe }); - } - - // - // GET: /Account/ExternalLoginCallback - [AllowAnonymous] - public async Task ExternalLoginCallback(string returnUrl) - { - var loginInfo = await AuthenticationManager.GetExternalLoginInfoAsync(); - if (loginInfo == null) - { - return RedirectToAction("Login"); - } - - // Sign in the user with this external login provider if the user already has a login - var result = await SignInManager.ExternalSignInAsync(loginInfo, isPersistent: false); - switch (result) - { - case SignInStatus.Success: - return RedirectToLocal(returnUrl); - case SignInStatus.LockedOut: - return View("Lockout"); - case SignInStatus.RequiresVerification: - return RedirectToAction("SendCode", new { ReturnUrl = returnUrl, RememberMe = false }); - case SignInStatus.Failure: - default: - // If the user does not have an account, then prompt the user to create an account - ViewBag.ReturnUrl = returnUrl; - ViewBag.LoginProvider = loginInfo.Login.LoginProvider; - return View("ExternalLoginConfirmation", new ExternalLoginConfirmationViewModel { Email = loginInfo.Email }); - } - } - - // - // POST: /Account/ExternalLoginConfirmation - [HttpPost] - [AllowAnonymous] - [ValidateAntiForgeryToken] - public async Task ExternalLoginConfirmation(ExternalLoginConfirmationViewModel model, string returnUrl) - { - if (User.Identity.IsAuthenticated) - { - return RedirectToAction("Index", "Manage"); - } - - if (ModelState.IsValid) - { - // Get the information about the user from the external login provider - var info = await AuthenticationManager.GetExternalLoginInfoAsync(); - if (info == null) - { - return View("ExternalLoginFailure"); - } - var user = new ApplicationUser { UserName = model.Email, Email = model.Email }; - var result = await UserManager.CreateAsync(user); - if (result.Succeeded) - { - result = await UserManager.AddLoginAsync(user.Id, info.Login); - if (result.Succeeded) - { - await SignInManager.SignInAsync(user, isPersistent: false, rememberBrowser: false); - return RedirectToLocal(returnUrl); - } - } - AddErrors(result); - } - - ViewBag.ReturnUrl = returnUrl; - return View(model); - } - - // - // POST: /Account/LogOff - [HttpPost] - [ValidateAntiForgeryToken] - public ActionResult LogOff() - { - AuthenticationManager.SignOut(DefaultAuthenticationTypes.ApplicationCookie); - return RedirectToAction("Index", "Home"); - } - - // - // GET: /Account/ExternalLoginFailure - [AllowAnonymous] - public ActionResult ExternalLoginFailure() - { - return View(); - } - - protected override void Dispose(bool disposing) - { - if (disposing) - { - if (_userManager != null) - { - _userManager.Dispose(); - _userManager = null; - } - - if (_signInManager != null) - { - _signInManager.Dispose(); - _signInManager = null; - } - } - - base.Dispose(disposing); - } - - #region Helpers - // Used for XSRF protection when adding external logins - private const string XsrfKey = "XsrfId"; - - private IAuthenticationManager AuthenticationManager - { - get - { - return HttpContext.GetOwinContext().Authentication; - } - } - - private void AddErrors(IdentityResult result) - { - foreach (var error in result.Errors) - { - ModelState.AddModelError("", error); - } - } - - private ActionResult RedirectToLocal(string returnUrl) - { - if (Url.IsLocalUrl(returnUrl)) - { - return Redirect(returnUrl); - } - return RedirectToAction("Index", "Home"); - } - - internal class ChallengeResult : HttpUnauthorizedResult - { - public ChallengeResult(string provider, string redirectUri) - : this(provider, redirectUri, null) - { - } - - public ChallengeResult(string provider, string redirectUri, string userId) - { - LoginProvider = provider; - RedirectUri = redirectUri; - UserId = userId; - } - - public string LoginProvider { get; set; } - public string RedirectUri { get; set; } - public string UserId { get; set; } - - public override void ExecuteResult(ControllerContext context) - { - var properties = new AuthenticationProperties { RedirectUri = RedirectUri }; - if (UserId != null) - { - properties.Dictionary[XsrfKey] = UserId; - } - context.HttpContext.GetOwinContext().Authentication.Challenge(properties, LoginProvider); - } - } - #endregion - } -} \ No newline at end of file diff --git a/AspNet4/Mvc/AdhocReportingMetaData/Controllers/EasyQuery/EasyReportController.cs b/AspNet4/Mvc/AdhocReportingMetaData/Controllers/EasyQuery/EasyReportController.cs deleted file mode 100644 index e34712cf..00000000 --- a/AspNet4/Mvc/AdhocReportingMetaData/Controllers/EasyQuery/EasyReportController.cs +++ /dev/null @@ -1,54 +0,0 @@ -using System; -using System.Web.Http; -using System.Configuration; - -using Korzh.EasyQuery.Services; -using Korzh.EasyQuery.AspNet; - -using EqDemo.Models; -using EqDemo.Services; -using System.Data.SqlClient; -using Microsoft.Extensions.Options; - -namespace EqDemo.Controllers -{ - - [RoutePrefix("api/adhoc-reporting")] - [Authorize] - public class EasyReportController : EasyQueryApiController - { - - protected override void ConfigureEasyQueryOptions(EasyQueryOptions options) - { - //use EasyQuery manager that generates SQL queries - options.UseManager(); - - options.DefaultModelId = "adhoc-reporting"; - - options.StoreModelInCache = true; - //it is required to register caching service, when StoreInCache is turned on - options.UseCaching((_) => new EqSessionCachingService()); - - //allow save query on sync for users with eq-manager role - options.SaveQueryOnSync = User.IsInRole("eq-manager"); - options.SaveNewQuery = true; - - options.ConnectionString = ConfigurationManager.ConnectionStrings["DefaultConnection"]?.ToString(); - options.UseDbConnectionModelLoader(settings => { - settings.AddTableFilter(tbl => !tbl.Name.StartsWith("sys")); - settings.AddFieldFilter(fld => !fld.IsForeignKey); - settings.AddFieldFilter(fld => { - if (fld.Name == "CompanyName") fld.Name = "Customer Name"; - return true; - }) ; - }); - - - options.UseDbConnection(); - - var dbContext = ApplicationDbContext.Create(); - - options.UseQueryStore((_) => new ReportStore(dbContext, User)); - } - } -} \ No newline at end of file diff --git a/AspNet4/Mvc/AdhocReportingMetaData/Controllers/HomeController.cs b/AspNet4/Mvc/AdhocReportingMetaData/Controllers/HomeController.cs index c655c924..594b6dd0 100644 --- a/AspNet4/Mvc/AdhocReportingMetaData/Controllers/HomeController.cs +++ b/AspNet4/Mvc/AdhocReportingMetaData/Controllers/HomeController.cs @@ -1,19 +1,12 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web; -using System.Web.Mvc; +using Microsoft.AspNetCore.Mvc; namespace EqDemo.Controllers { - [Route("/")] public class HomeController : Controller { - [Authorize] - [Route("")] - public ActionResult Index() + public IActionResult Index() { return View(); } } -} \ No newline at end of file +} diff --git a/AspNet4/Mvc/AdhocReportingMetaData/Controllers/ManageController.cs b/AspNet4/Mvc/AdhocReportingMetaData/Controllers/ManageController.cs deleted file mode 100644 index 30b3b9c3..00000000 --- a/AspNet4/Mvc/AdhocReportingMetaData/Controllers/ManageController.cs +++ /dev/null @@ -1,389 +0,0 @@ -using System; -using System.Linq; -using System.Threading.Tasks; -using System.Web; -using System.Web.Mvc; -using Microsoft.AspNet.Identity; -using Microsoft.AspNet.Identity.Owin; -using Microsoft.Owin.Security; -using EqDemo.Models; - -namespace EqDemo.Controllers -{ - [Authorize] - public class ManageController : Controller - { - private ApplicationSignInManager _signInManager; - private ApplicationUserManager _userManager; - - public ManageController() - { - } - - public ManageController(ApplicationUserManager userManager, ApplicationSignInManager signInManager) - { - UserManager = userManager; - SignInManager = signInManager; - } - - public ApplicationSignInManager SignInManager - { - get - { - return _signInManager ?? HttpContext.GetOwinContext().Get(); - } - private set - { - _signInManager = value; - } - } - - public ApplicationUserManager UserManager - { - get - { - return _userManager ?? HttpContext.GetOwinContext().GetUserManager(); - } - private set - { - _userManager = value; - } - } - - // - // GET: /Manage/Index - public async Task Index(ManageMessageId? message) - { - ViewBag.StatusMessage = - message == ManageMessageId.ChangePasswordSuccess ? "Your password has been changed." - : message == ManageMessageId.SetPasswordSuccess ? "Your password has been set." - : message == ManageMessageId.SetTwoFactorSuccess ? "Your two-factor authentication provider has been set." - : message == ManageMessageId.Error ? "An error has occurred." - : message == ManageMessageId.AddPhoneSuccess ? "Your phone number was added." - : message == ManageMessageId.RemovePhoneSuccess ? "Your phone number was removed." - : ""; - - var userId = User.Identity.GetUserId(); - var model = new IndexViewModel - { - HasPassword = HasPassword(), - PhoneNumber = await UserManager.GetPhoneNumberAsync(userId), - TwoFactor = await UserManager.GetTwoFactorEnabledAsync(userId), - Logins = await UserManager.GetLoginsAsync(userId), - BrowserRemembered = await AuthenticationManager.TwoFactorBrowserRememberedAsync(userId) - }; - return View(model); - } - - // - // POST: /Manage/RemoveLogin - [HttpPost] - [ValidateAntiForgeryToken] - public async Task RemoveLogin(string loginProvider, string providerKey) - { - ManageMessageId? message; - var result = await UserManager.RemoveLoginAsync(User.Identity.GetUserId(), new UserLoginInfo(loginProvider, providerKey)); - if (result.Succeeded) - { - var user = await UserManager.FindByIdAsync(User.Identity.GetUserId()); - if (user != null) - { - await SignInManager.SignInAsync(user, isPersistent: false, rememberBrowser: false); - } - message = ManageMessageId.RemoveLoginSuccess; - } - else - { - message = ManageMessageId.Error; - } - return RedirectToAction("ManageLogins", new { Message = message }); - } - - // - // GET: /Manage/AddPhoneNumber - public ActionResult AddPhoneNumber() - { - return View(); - } - - // - // POST: /Manage/AddPhoneNumber - [HttpPost] - [ValidateAntiForgeryToken] - public async Task AddPhoneNumber(AddPhoneNumberViewModel model) - { - if (!ModelState.IsValid) - { - return View(model); - } - // Generate the token and send it - var code = await UserManager.GenerateChangePhoneNumberTokenAsync(User.Identity.GetUserId(), model.Number); - if (UserManager.SmsService != null) - { - var message = new IdentityMessage - { - Destination = model.Number, - Body = "Your security code is: " + code - }; - await UserManager.SmsService.SendAsync(message); - } - return RedirectToAction("VerifyPhoneNumber", new { PhoneNumber = model.Number }); - } - - // - // POST: /Manage/EnableTwoFactorAuthentication - [HttpPost] - [ValidateAntiForgeryToken] - public async Task EnableTwoFactorAuthentication() - { - await UserManager.SetTwoFactorEnabledAsync(User.Identity.GetUserId(), true); - var user = await UserManager.FindByIdAsync(User.Identity.GetUserId()); - if (user != null) - { - await SignInManager.SignInAsync(user, isPersistent: false, rememberBrowser: false); - } - return RedirectToAction("Index", "Manage"); - } - - // - // POST: /Manage/DisableTwoFactorAuthentication - [HttpPost] - [ValidateAntiForgeryToken] - public async Task DisableTwoFactorAuthentication() - { - await UserManager.SetTwoFactorEnabledAsync(User.Identity.GetUserId(), false); - var user = await UserManager.FindByIdAsync(User.Identity.GetUserId()); - if (user != null) - { - await SignInManager.SignInAsync(user, isPersistent: false, rememberBrowser: false); - } - return RedirectToAction("Index", "Manage"); - } - - // - // GET: /Manage/VerifyPhoneNumber - public async Task VerifyPhoneNumber(string phoneNumber) - { - var code = await UserManager.GenerateChangePhoneNumberTokenAsync(User.Identity.GetUserId(), phoneNumber); - // Send an SMS through the SMS provider to verify the phone number - return phoneNumber == null ? View("Error") : View(new VerifyPhoneNumberViewModel { PhoneNumber = phoneNumber }); - } - - // - // POST: /Manage/VerifyPhoneNumber - [HttpPost] - [ValidateAntiForgeryToken] - public async Task VerifyPhoneNumber(VerifyPhoneNumberViewModel model) - { - if (!ModelState.IsValid) - { - return View(model); - } - var result = await UserManager.ChangePhoneNumberAsync(User.Identity.GetUserId(), model.PhoneNumber, model.Code); - if (result.Succeeded) - { - var user = await UserManager.FindByIdAsync(User.Identity.GetUserId()); - if (user != null) - { - await SignInManager.SignInAsync(user, isPersistent: false, rememberBrowser: false); - } - return RedirectToAction("Index", new { Message = ManageMessageId.AddPhoneSuccess }); - } - // If we got this far, something failed, redisplay form - ModelState.AddModelError("", "Failed to verify phone"); - return View(model); - } - - // - // POST: /Manage/RemovePhoneNumber - [HttpPost] - [ValidateAntiForgeryToken] - public async Task RemovePhoneNumber() - { - var result = await UserManager.SetPhoneNumberAsync(User.Identity.GetUserId(), null); - if (!result.Succeeded) - { - return RedirectToAction("Index", new { Message = ManageMessageId.Error }); - } - var user = await UserManager.FindByIdAsync(User.Identity.GetUserId()); - if (user != null) - { - await SignInManager.SignInAsync(user, isPersistent: false, rememberBrowser: false); - } - return RedirectToAction("Index", new { Message = ManageMessageId.RemovePhoneSuccess }); - } - - // - // GET: /Manage/ChangePassword - public ActionResult ChangePassword() - { - return View(); - } - - // - // POST: /Manage/ChangePassword - [HttpPost] - [ValidateAntiForgeryToken] - public async Task ChangePassword(ChangePasswordViewModel model) - { - if (!ModelState.IsValid) - { - return View(model); - } - var result = await UserManager.ChangePasswordAsync(User.Identity.GetUserId(), model.OldPassword, model.NewPassword); - if (result.Succeeded) - { - var user = await UserManager.FindByIdAsync(User.Identity.GetUserId()); - if (user != null) - { - await SignInManager.SignInAsync(user, isPersistent: false, rememberBrowser: false); - } - return RedirectToAction("Index", new { Message = ManageMessageId.ChangePasswordSuccess }); - } - AddErrors(result); - return View(model); - } - - // - // GET: /Manage/SetPassword - public ActionResult SetPassword() - { - return View(); - } - - // - // POST: /Manage/SetPassword - [HttpPost] - [ValidateAntiForgeryToken] - public async Task SetPassword(SetPasswordViewModel model) - { - if (ModelState.IsValid) - { - var result = await UserManager.AddPasswordAsync(User.Identity.GetUserId(), model.NewPassword); - if (result.Succeeded) - { - var user = await UserManager.FindByIdAsync(User.Identity.GetUserId()); - if (user != null) - { - await SignInManager.SignInAsync(user, isPersistent: false, rememberBrowser: false); - } - return RedirectToAction("Index", new { Message = ManageMessageId.SetPasswordSuccess }); - } - AddErrors(result); - } - - // If we got this far, something failed, redisplay form - return View(model); - } - - // - // GET: /Manage/ManageLogins - public async Task ManageLogins(ManageMessageId? message) - { - ViewBag.StatusMessage = - message == ManageMessageId.RemoveLoginSuccess ? "The external login was removed." - : message == ManageMessageId.Error ? "An error has occurred." - : ""; - var user = await UserManager.FindByIdAsync(User.Identity.GetUserId()); - if (user == null) - { - return View("Error"); - } - var userLogins = await UserManager.GetLoginsAsync(User.Identity.GetUserId()); - var otherLogins = AuthenticationManager.GetExternalAuthenticationTypes().Where(auth => userLogins.All(ul => auth.AuthenticationType != ul.LoginProvider)).ToList(); - ViewBag.ShowRemoveButton = user.PasswordHash != null || userLogins.Count > 1; - return View(new ManageLoginsViewModel - { - CurrentLogins = userLogins, - OtherLogins = otherLogins - }); - } - - // - // POST: /Manage/LinkLogin - [HttpPost] - [ValidateAntiForgeryToken] - public ActionResult LinkLogin(string provider) - { - // Request a redirect to the external login provider to link a login for the current user - return new AccountController.ChallengeResult(provider, Url.Action("LinkLoginCallback", "Manage"), User.Identity.GetUserId()); - } - - // - // GET: /Manage/LinkLoginCallback - public async Task LinkLoginCallback() - { - var loginInfo = await AuthenticationManager.GetExternalLoginInfoAsync(XsrfKey, User.Identity.GetUserId()); - if (loginInfo == null) - { - return RedirectToAction("ManageLogins", new { Message = ManageMessageId.Error }); - } - var result = await UserManager.AddLoginAsync(User.Identity.GetUserId(), loginInfo.Login); - return result.Succeeded ? RedirectToAction("ManageLogins") : RedirectToAction("ManageLogins", new { Message = ManageMessageId.Error }); - } - - protected override void Dispose(bool disposing) - { - if (disposing && _userManager != null) - { - _userManager.Dispose(); - _userManager = null; - } - - base.Dispose(disposing); - } - -#region Helpers - // Used for XSRF protection when adding external logins - private const string XsrfKey = "XsrfId"; - - private IAuthenticationManager AuthenticationManager - { - get - { - return HttpContext.GetOwinContext().Authentication; - } - } - - private void AddErrors(IdentityResult result) - { - foreach (var error in result.Errors) - { - ModelState.AddModelError("", error); - } - } - - private bool HasPassword() - { - var user = UserManager.FindById(User.Identity.GetUserId()); - if (user != null) - { - return user.PasswordHash != null; - } - return false; - } - - private bool HasPhoneNumber() - { - var user = UserManager.FindById(User.Identity.GetUserId()); - if (user != null) - { - return user.PhoneNumber != null; - } - return false; - } - - public enum ManageMessageId - { - AddPhoneSuccess, - ChangePasswordSuccess, - SetTwoFactorSuccess, - SetPasswordSuccess, - RemoveLoginSuccess, - RemovePhoneSuccess, - Error - } - -#endregion - } -} \ No newline at end of file diff --git a/AspNet4/Mvc/AdhocReportingMetaData/Data/ApplicationDbContext.cs b/AspNet4/Mvc/AdhocReportingMetaData/Data/ApplicationDbContext.cs index 489b4f6d..42839e79 100644 --- a/AspNet4/Mvc/AdhocReportingMetaData/Data/ApplicationDbContext.cs +++ b/AspNet4/Mvc/AdhocReportingMetaData/Data/ApplicationDbContext.cs @@ -1,19 +1,16 @@ -using System.Data.Entity; - -using Microsoft.AspNet.Identity.EntityFramework; +using Microsoft.AspNetCore.Identity.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; namespace EqDemo.Models { public class ApplicationDbContext : IdentityDbContext { - public ApplicationDbContext() - : base("DefaultConnection", throwIfV1Schema: false) + public ApplicationDbContext(DbContextOptions options) + : base(options) { } - - #region NWind public DbSet Categories { get; set; } @@ -35,7 +32,7 @@ public ApplicationDbContext() public DbSet Reports { get; set; } - protected override void OnModelCreating(DbModelBuilder modelBuilder) + protected override void OnModelCreating(ModelBuilder modelBuilder) { base.OnModelCreating(modelBuilder); @@ -44,11 +41,6 @@ protected override void OnModelCreating(DbModelBuilder modelBuilder) .HasKey(od => new { od.OrderID, od.ProductID }); } - public static ApplicationDbContext Create() - { - return new ApplicationDbContext(); - } - } -} \ No newline at end of file +} diff --git a/AspNet4/Mvc/AdhocReportingMetaData/EqDemo.AspNet4x.AdhocReporting.Metadata.csproj b/AspNet4/Mvc/AdhocReportingMetaData/EqDemo.AspNet4x.AdhocReporting.Metadata.csproj index fb3a2ec1..a238a2b3 100644 --- a/AspNet4/Mvc/AdhocReportingMetaData/EqDemo.AspNet4x.AdhocReporting.Metadata.csproj +++ b/AspNet4/Mvc/AdhocReportingMetaData/EqDemo.AspNet4x.AdhocReporting.Metadata.csproj @@ -1,293 +1,33 @@ - - - - + - Debug - AnyCPU - - - 2.0 - {56835F83-C5B2-4C59-B5BE-EA1B2AC12215} - {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - Library - Properties + net8.0 EqDemo - EqDemo.AspNet4x.AdhocReporting.MetaData - v4.6.1 - false - true - - 44378 - - - - - - - - - true - full - false - bin\ - DEBUG;TRACE - prompt - 4 - - - true - pdbonly - true - bin\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - - - - - - - + + + + - - 7.4.0-rc04 - - - 4.8.6 - - - 4.7.2 - - - 1.6.0 - - - 5.2.7 - - - 5.2.7 - - - 5.2.7 - - - 3.2.7 - - - 3.2.7 - - - 1.1.3 - - - 1.0.0 - - - 2.2.4 - - - 2.2.2 - - - 6.2.0 - - - 2.0.0 - - - 1.0.0 - - - 4.2.2 - - - 4.2.2 - - - 4.2.2 - - - 4.2.2 - - - 4.2.2 - - - 3.5.1 - - - 7.6.0 - - - - - - - - - - - - - - - - - - - - - - - - - Global.asax - - - - - 201907161537049_InitialCreate.cs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Designer - - - Web.config - - - Web.config - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + - - - - - - - - - - - - - + + - - 201907161537049_InitialCreate.cs - + + - ~/App_Data/EqDemoData.zip + PreserveNewest - - 10.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - - - - - - - - - True - True - 49981 - / - https://localhost:44378/ - False - False - - - False - - - - - - - - - - - - \ No newline at end of file + diff --git a/AspNet4/Mvc/AdhocReportingMetaData/Global.asax b/AspNet4/Mvc/AdhocReportingMetaData/Global.asax deleted file mode 100644 index c3267ad8..00000000 --- a/AspNet4/Mvc/AdhocReportingMetaData/Global.asax +++ /dev/null @@ -1 +0,0 @@ -<%@ Application Codebehind="Global.asax.cs" Inherits="EqDemo.MvcApplication" Language="C#" %> diff --git a/AspNet4/Mvc/AdhocReportingMetaData/Global.asax.cs b/AspNet4/Mvc/AdhocReportingMetaData/Global.asax.cs deleted file mode 100644 index ba3f72e7..00000000 --- a/AspNet4/Mvc/AdhocReportingMetaData/Global.asax.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web; -using System.Web.Http; -using System.Web.Mvc; -using System.Web.Optimization; -using System.Web.Routing; - -namespace EqDemo -{ - public class MvcApplication : System.Web.HttpApplication - { - protected void Application_Start() - { - AreaRegistration.RegisterAllAreas(); - GlobalConfiguration.Configure(WebApiConfig.Register); - FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); - RouteConfig.RegisterRoutes(RouteTable.Routes); - BundleConfig.RegisterBundles(BundleTable.Bundles); - - GlobalConfiguration.Configuration.EnsureInitialized(); - } - - void Session_Start(object sender, EventArgs e) - { - // Code that runs when a new session is started - string sessionId = Session.SessionID; - } - - protected void Application_PostAuthorizeRequest() - { - //here we enable session for WebApi Controllers - System.Web.HttpContext.Current.SetSessionStateBehavior(System.Web.SessionState.SessionStateBehavior.Required); - } - } -} diff --git a/AspNet4/Mvc/AdhocReportingMetaData/IdentityHelper.cs b/AspNet4/Mvc/AdhocReportingMetaData/IdentityHelper.cs deleted file mode 100644 index 5559fe28..00000000 --- a/AspNet4/Mvc/AdhocReportingMetaData/IdentityHelper.cs +++ /dev/null @@ -1,80 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web; - -using Microsoft.AspNet.Identity; -using Microsoft.AspNet.Identity.EntityFramework; - -using EqDemo.Models; -using EqDemo.Services; -using System.Configuration; - -namespace EqDemo -{ - internal static class IdentityHelper - { - - public static void SeedEqManagerRole() - { - - const string eqManagerRole = "eq-manager"; - - using (var context = ApplicationDbContext.Create()) - { - var roleManager = new RoleManager(new RoleStore(context)); - if (!roleManager.RoleExists(eqManagerRole)) { - roleManager.Create(new IdentityRole { Name = eqManagerRole }); - } - } - } - - public static void SeedDefaultUser() - { - const string defaultUserEmail = "demo@korzh.com"; - const string defaultUserPassword = "demo"; - - using (var dbContext = ApplicationDbContext.Create()) - { - var userManager = new UserManager(new UserStore(dbContext)); - // Configure validation logic for passwords - userManager.PasswordValidator = new PasswordValidator - { - RequiredLength = 4, - RequireNonLetterOrDigit = false, - RequireDigit = false, - RequireLowercase = false, - RequireUppercase = false, - }; - - var resetDemoUserStr = ConfigurationManager.AppSettings["resetDefaultUser"]; - var resetDemoUser = resetDemoUserStr != null ? bool.Parse(resetDemoUserStr) : false; - - var user = userManager.FindByEmail(defaultUserEmail); - - //remove default user if "resetDefaultUser" option is set to true - if (resetDemoUser && user != null) { - dbContext.Reports.RemoveRange(dbContext.Reports.Where(r => r.OwnerId == user.Id)); - dbContext.SaveChanges(); - - userManager.DeleteAsync(user).GetAwaiter().GetResult(); - user = null; - } - - if (user == null) { - user = new ApplicationUser { - Email = defaultUserEmail, - UserName = defaultUserEmail, - EmailConfirmed = true - }; - - var result = userManager.Create(user, defaultUserPassword); - if (result.Succeeded) { - var reportGenerator = new DefaultReportGenerator(dbContext); - reportGenerator.Generate(user); - } - } - } - } - } -} \ No newline at end of file diff --git a/AspNet4/Mvc/AdhocReportingMetaData/Migrations/201907161537049_InitialCreate.Designer.cs b/AspNet4/Mvc/AdhocReportingMetaData/Migrations/201907161537049_InitialCreate.Designer.cs deleted file mode 100644 index dc17d5a8..00000000 --- a/AspNet4/Mvc/AdhocReportingMetaData/Migrations/201907161537049_InitialCreate.Designer.cs +++ /dev/null @@ -1,29 +0,0 @@ -// -namespace EqDemo.Migrations -{ - using System.CodeDom.Compiler; - using System.Data.Entity.Migrations; - using System.Data.Entity.Migrations.Infrastructure; - using System.Resources; - - [GeneratedCode("EntityFramework.Migrations", "6.2.0-61023")] - public sealed partial class InitialCreate : IMigrationMetadata - { - private readonly ResourceManager Resources = new ResourceManager(typeof(InitialCreate)); - - string IMigrationMetadata.Id - { - get { return "201907161537049_InitialCreate"; } - } - - string IMigrationMetadata.Source - { - get { return null; } - } - - string IMigrationMetadata.Target - { - get { return Resources.GetString("Target"); } - } - } -} diff --git a/AspNet4/Mvc/AdhocReportingMetaData/Migrations/201907161537049_InitialCreate.cs b/AspNet4/Mvc/AdhocReportingMetaData/Migrations/201907161537049_InitialCreate.cs deleted file mode 100644 index f0c41b39..00000000 --- a/AspNet4/Mvc/AdhocReportingMetaData/Migrations/201907161537049_InitialCreate.cs +++ /dev/null @@ -1,302 +0,0 @@ -namespace EqDemo.Migrations -{ - using System; - using System.Data.Entity.Migrations; - - public partial class InitialCreate : DbMigration - { - public override void Up() - { - CreateTable( - "dbo.Categories", - c => new - { - CategoryID = c.Int(nullable: false), - CategoryName = c.String(), - Description = c.String(), - Picture = c.Binary(), - }) - .PrimaryKey(t => t.CategoryID); - - CreateTable( - "dbo.Customers", - c => new - { - CustomerID = c.String(nullable: false, maxLength: 128), - CompanyName = c.String(), - Address = c.String(), - City = c.String(), - Region = c.String(), - PostalCode = c.String(), - Country = c.String(), - ContactName = c.String(), - ContactTitle = c.String(), - Phone = c.String(), - Fax = c.String(), - }) - .PrimaryKey(t => t.CustomerID); - - CreateTable( - "dbo.Employees", - c => new - { - EmployeeID = c.Int(nullable: false), - LastName = c.String(nullable: false), - FirstName = c.String(nullable: false), - Title = c.String(maxLength: 30), - TitleOfCourtesy = c.String(), - BirthDate = c.DateTime(), - HireDate = c.DateTime(), - Address = c.String(), - City = c.String(), - Region = c.String(), - PostalCode = c.String(), - Country = c.String(), - HomePhone = c.String(maxLength: 24), - Extension = c.String(maxLength: 4), - Photo = c.Binary(), - PhotoPath = c.String(), - Notes = c.String(), - ReportsTo = c.Int(), - }) - .PrimaryKey(t => t.EmployeeID) - .ForeignKey("dbo.Employees", t => t.ReportsTo) - .Index(t => t.ReportsTo); - - CreateTable( - "dbo.Orders", - c => new - { - OrderID = c.Int(nullable: false), - OrderDate = c.DateTime(), - RequiredDate = c.DateTime(), - ShippedDate = c.DateTime(), - Freight = c.Decimal(precision: 18, scale: 2), - CustomerID = c.String(maxLength: 128), - EmployeeID = c.Int(), - ShipVia = c.Int(), - ShipName = c.String(), - ShipAddress = c.String(), - ShipCity = c.String(), - ShipRegion = c.String(), - ShipPostalCode = c.String(), - ShipCountry = c.String(), - }) - .PrimaryKey(t => t.OrderID) - .ForeignKey("dbo.Customers", t => t.CustomerID) - .ForeignKey("dbo.Employees", t => t.EmployeeID) - .Index(t => t.CustomerID) - .Index(t => t.EmployeeID); - - CreateTable( - "dbo.Order_Details", - c => new - { - OrderID = c.Int(nullable: false), - ProductID = c.Int(nullable: false), - UnitPrice = c.Decimal(nullable: false, precision: 18, scale: 2), - Quantity = c.Short(nullable: false), - Discount = c.Single(nullable: false), - }) - .PrimaryKey(t => new { t.OrderID, t.ProductID }) - .ForeignKey("dbo.Orders", t => t.OrderID, cascadeDelete: true) - .ForeignKey("dbo.Products", t => t.ProductID, cascadeDelete: true) - .Index(t => t.OrderID) - .Index(t => t.ProductID); - - CreateTable( - "dbo.Products", - c => new - { - ProductID = c.Int(nullable: false), - ProductName = c.String(), - SupplierID = c.Int(), - CategoryID = c.Int(), - QuantityPerUnit = c.String(), - UnitPrice = c.Decimal(precision: 18, scale: 2), - UnitsInStock = c.Short(), - UnitsOnOrder = c.Short(), - ReorderLevel = c.Short(), - Discontinued = c.Boolean(nullable: false), - }) - .PrimaryKey(t => t.ProductID) - .ForeignKey("dbo.Categories", t => t.CategoryID) - .ForeignKey("dbo.Suppliers", t => t.SupplierID) - .Index(t => t.SupplierID) - .Index(t => t.CategoryID); - - CreateTable( - "dbo.Suppliers", - c => new - { - SupplierID = c.Int(nullable: false, identity: true), - CompanyName = c.String(), - ContactName = c.String(), - ContactTitle = c.String(), - Address = c.String(), - City = c.String(), - Region = c.String(), - PostalCode = c.String(), - Country = c.String(), - Phone = c.String(), - Fax = c.String(), - HomePage = c.String(), - }) - .PrimaryKey(t => t.SupplierID); - - CreateTable( - "dbo.Reports", - c => new - { - Id = c.String(nullable: false, maxLength: 128), - Name = c.String(), - Description = c.String(), - ModelId = c.String(), - QueryJson = c.String(), - OwnerId = c.String(maxLength: 128), - }) - .PrimaryKey(t => t.Id) - .ForeignKey("dbo.IdentityUsers", t => t.OwnerId) - .Index(t => t.OwnerId); - - CreateTable( - "dbo.IdentityUsers", - c => new - { - Id = c.String(nullable: false, maxLength: 128), - Email = c.String(maxLength: 256), - EmailConfirmed = c.Boolean(nullable: false), - PasswordHash = c.String(), - SecurityStamp = c.String(), - PhoneNumber = c.String(), - PhoneNumberConfirmed = c.Boolean(nullable: false), - TwoFactorEnabled = c.Boolean(nullable: false), - LockoutEndDateUtc = c.DateTime(), - LockoutEnabled = c.Boolean(nullable: false), - AccessFailedCount = c.Int(nullable: false), - UserName = c.String(nullable: false, maxLength: 256), - }) - .PrimaryKey(t => t.Id) - .Index(t => t.UserName, unique: true, name: "UserNameIndex"); - - CreateTable( - "dbo.AspNetUserClaims", - c => new - { - Id = c.Int(nullable: false, identity: true), - UserId = c.String(), - ClaimType = c.String(), - ClaimValue = c.String(), - IdentityUser_Id = c.String(maxLength: 128), - }) - .PrimaryKey(t => t.Id) - .ForeignKey("dbo.IdentityUsers", t => t.IdentityUser_Id) - .Index(t => t.IdentityUser_Id); - - CreateTable( - "dbo.AspNetUserLogins", - c => new - { - LoginProvider = c.String(nullable: false, maxLength: 128), - ProviderKey = c.String(nullable: false, maxLength: 128), - UserId = c.String(nullable: false, maxLength: 128), - IdentityUser_Id = c.String(maxLength: 128), - }) - .PrimaryKey(t => new { t.LoginProvider, t.ProviderKey, t.UserId }) - .ForeignKey("dbo.IdentityUsers", t => t.IdentityUser_Id) - .Index(t => t.IdentityUser_Id); - - CreateTable( - "dbo.AspNetUserRoles", - c => new - { - UserId = c.String(nullable: false, maxLength: 128), - RoleId = c.String(nullable: false, maxLength: 128), - IdentityUser_Id = c.String(maxLength: 128), - }) - .PrimaryKey(t => new { t.UserId, t.RoleId }) - .ForeignKey("dbo.IdentityUsers", t => t.IdentityUser_Id) - .ForeignKey("dbo.AspNetRoles", t => t.RoleId, cascadeDelete: true) - .Index(t => t.RoleId) - .Index(t => t.IdentityUser_Id); - - CreateTable( - "dbo.AspNetRoles", - c => new - { - Id = c.String(nullable: false, maxLength: 128), - Name = c.String(nullable: false, maxLength: 256), - }) - .PrimaryKey(t => t.Id) - .Index(t => t.Name, unique: true, name: "RoleNameIndex"); - - CreateTable( - "dbo.Shippers", - c => new - { - ShipperID = c.Int(nullable: false, identity: true), - CompanyName = c.String(), - Phone = c.String(), - }) - .PrimaryKey(t => t.ShipperID); - - CreateTable( - "dbo.AspNetUsers", - c => new - { - Id = c.String(nullable: false, maxLength: 128), - }) - .PrimaryKey(t => t.Id) - .ForeignKey("dbo.IdentityUsers", t => t.Id) - .Index(t => t.Id); - - } - - public override void Down() - { - DropForeignKey("dbo.AspNetUsers", "Id", "dbo.IdentityUsers"); - DropForeignKey("dbo.AspNetUserRoles", "RoleId", "dbo.AspNetRoles"); - DropForeignKey("dbo.Reports", "OwnerId", "dbo.IdentityUsers"); - DropForeignKey("dbo.AspNetUserRoles", "IdentityUser_Id", "dbo.IdentityUsers"); - DropForeignKey("dbo.AspNetUserLogins", "IdentityUser_Id", "dbo.IdentityUsers"); - DropForeignKey("dbo.AspNetUserClaims", "IdentityUser_Id", "dbo.IdentityUsers"); - DropForeignKey("dbo.Order_Details", "ProductID", "dbo.Products"); - DropForeignKey("dbo.Products", "SupplierID", "dbo.Suppliers"); - DropForeignKey("dbo.Products", "CategoryID", "dbo.Categories"); - DropForeignKey("dbo.Order_Details", "OrderID", "dbo.Orders"); - DropForeignKey("dbo.Orders", "EmployeeID", "dbo.Employees"); - DropForeignKey("dbo.Orders", "CustomerID", "dbo.Customers"); - DropForeignKey("dbo.Employees", "ReportsTo", "dbo.Employees"); - DropIndex("dbo.AspNetUsers", new[] { "Id" }); - DropIndex("dbo.AspNetRoles", "RoleNameIndex"); - DropIndex("dbo.AspNetUserRoles", new[] { "IdentityUser_Id" }); - DropIndex("dbo.AspNetUserRoles", new[] { "RoleId" }); - DropIndex("dbo.AspNetUserLogins", new[] { "IdentityUser_Id" }); - DropIndex("dbo.AspNetUserClaims", new[] { "IdentityUser_Id" }); - DropIndex("dbo.IdentityUsers", "UserNameIndex"); - DropIndex("dbo.Reports", new[] { "OwnerId" }); - DropIndex("dbo.Products", new[] { "CategoryID" }); - DropIndex("dbo.Products", new[] { "SupplierID" }); - DropIndex("dbo.Order_Details", new[] { "ProductID" }); - DropIndex("dbo.Order_Details", new[] { "OrderID" }); - DropIndex("dbo.Orders", new[] { "EmployeeID" }); - DropIndex("dbo.Orders", new[] { "CustomerID" }); - DropIndex("dbo.Employees", new[] { "ReportsTo" }); - DropTable("dbo.AspNetUsers"); - DropTable("dbo.Shippers"); - DropTable("dbo.AspNetRoles"); - DropTable("dbo.AspNetUserRoles"); - DropTable("dbo.AspNetUserLogins"); - DropTable("dbo.AspNetUserClaims"); - DropTable("dbo.IdentityUsers"); - DropTable("dbo.Reports"); - DropTable("dbo.Suppliers"); - DropTable("dbo.Products"); - DropTable("dbo.Order_Details"); - DropTable("dbo.Orders"); - DropTable("dbo.Employees"); - DropTable("dbo.Customers"); - DropTable("dbo.Categories"); - } - } -} diff --git a/AspNet4/Mvc/AdhocReportingMetaData/Migrations/201907161537049_InitialCreate.resx b/AspNet4/Mvc/AdhocReportingMetaData/Migrations/201907161537049_InitialCreate.resx deleted file mode 100644 index 27d94ce8..00000000 --- a/AspNet4/Mvc/AdhocReportingMetaData/Migrations/201907161537049_InitialCreate.resx +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - H4sIAAAAAAAEAO1dzW7kOJK+L7DvkMjTzKLGWba7C70FewYu/8x4t6rsKbsbezNkJW0LrZSyJWV1GYt5sj3sI+0rLCXxnwyKlChlusbwJc2fL8hgMEgFI8j/+5//PfrLt1U6+4qKMsmz4/n+3tv5DGVxvkyyx+P5pnr400/zv/z5X//l6Hy5+jb7hZY7rMvhmll5PH+qqvX7xaKMn9AqKvdWSVzkZf5Q7cX5ahEt88XB27f/vtjfXyAMMcdYs9nRl01WJSvU/IP/Pc2zGK2rTZR+ypcoLUk6zrlpUGefoxUq11GMjufnv52U68+o+uEMrfK9tvx8dpImEW7LDUof5rMoy/IqqnBL3/9copuqyLPHmzVOiNLb5zXC5R6itESkB+95cdfOvD2oO7PgFSlUvCmrfOUJuH9IuLNQq/fi8ZxxD/PvHPO5eq573fDweH4aVegxL57nM5XY+9O0qAuaWbxHK76ZSdlvmFBg2an/3sxON2m1KdBxhjZVEaVvZteb+zSJ/xM93+a/ouw426Sp2EjcTJwnJeCk6yJfo6J6/oIeSNMvl/PZQq63UCuyakKdtlOXWXV4MJ99xsSj+xQxGRAYcFPlBforylCB+7q8jqoKFXgIP+cZ0igrdCh36v8oRSx4eBbNZ5+ibx9R9lg9Hc/xz/nsIvmGljSFtOLnLMGTDleqik0nsTNUxkWybiVkZFrXSVwPJqXzIcmiWnhc6IjARwsuiXb5bKQSFf7ySSq+VPk0jOD+wU9OI6jJdIes5qt1lE0jqifLZYHKcnQ6p1iKRifyBT1OMuXysorSU1x+fLbleCEuxuccXuCrKK4mETlC6zap0vGJXT81i8PIVC5qlKA0nPXx+Wqd5s8IeetjWvGl6uNx9wsfozLUbPDU/hdJsS3SXVPy8G2AudIQuXrAmq2oUDm+avuQFNXTGRYASqn+fZusOiv+LSlQn3qvS+rrklqLD97sdq0+Bz8EIHT+rUJZaR+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0XslMltm46EO4h2EXQjRj2BDHOB5hinAr1/uwtfWm81GlKunXc6KfnySsh3ZCYUU/St2b9E2kaoWru5HZUnaoso5E/iUFu9jdOhs4pbhKGrNscJqbnqCtg0lSdaOiqtOsL78aG6x/kFdQ86PA8yjiN3TzrUhnoIn3z3aSp8uqDWpOmDu6qdwBp6aj+llYVV2RK2wsoSLd1V9hbSm8jhusm3EXA3oVM64zGk0FqeuLVums7POkQXOErq1+QtCLDxJQG9y53nQZaPXqHtcoal8+DeDHjZIDAj6E6qgxHgk0jjMELaKAJ39QdmBNlrdfABek9mHDaI20fzpe7DmSBZmw3dh63RgTsuf3CJ78eGG2nBoGoZacjsajG8GjpsGp+tjvRQw5+BY0FtiYHlyfDZor2F6M5U7Rp9lne0aL96SAL+V7su/2jxZZPVgcPtf2eoTB45RP0QQIZiyfTGylxmDzm1/iktokXUKw/wgrmMquikqJKHKK5wdh0znGSP81kTylnvmu/R8jK72lTrTYW7jFb3qbTpqi2JNvpHC63NR1fNrQ1liC7gZiZ1rPVV9mGTpEvW7gtDSAIAUZsoSURKPZZVHZny+MyQPmvPI0FAhH3MsnqL8CcHBiuvspvoK+rTNix7H9FjFD/zwEoIpHsgZLYfnSXRYxGtSoLB6+N/sQwvV9/+/P+ecLZXgQcBAA== - - - dbo - - \ No newline at end of file diff --git a/AspNet4/Mvc/AdhocReportingMetaData/Migrations/Configuration.cs b/AspNet4/Mvc/AdhocReportingMetaData/Migrations/Configuration.cs deleted file mode 100644 index 70d34a71..00000000 --- a/AspNet4/Mvc/AdhocReportingMetaData/Migrations/Configuration.cs +++ /dev/null @@ -1,33 +0,0 @@ -namespace EqDemo.Migrations -{ - using System; - using System.Data.Entity; - using System.Data.Entity.Migrations; - using System.IO; - using System.Linq; - - using Korzh.DbUtils; - - internal sealed class Configuration : DbMigrationsConfiguration - { - public Configuration() - { - AutomaticMigrationsEnabled = false; - ContextKey = "EqDemo.Models.ApplicationDbContext"; - } - - protected override void Seed(EqDemo.Models.ApplicationDbContext context) - { - // This method will be called after migrating to the latest version. - - // You can use the DbSet.AddOrUpdate() helper extension method - // to avoid creating duplicate seed data. - - Korzh.DbUtils.DbInitializer.Create(options => { - options.UseSqlServer(context.Database.Connection.ConnectionString); - options.UseZipPacker(System.Web.Hosting.HostingEnvironment.MapPath("~/App_Data/EqDemoData.zip")); - }) - .Seed(); - } - } -} diff --git a/AspNet4/Mvc/AdhocReportingMetaData/Models/AccountViewModels.cs b/AspNet4/Mvc/AdhocReportingMetaData/Models/AccountViewModels.cs deleted file mode 100644 index 59cc06d3..00000000 --- a/AspNet4/Mvc/AdhocReportingMetaData/Models/AccountViewModels.cs +++ /dev/null @@ -1,113 +0,0 @@ -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; - -namespace EqDemo.Models -{ - public class ExternalLoginConfirmationViewModel - { - [Required] - [Display(Name = "Email")] - public string Email { get; set; } - } - - public class ExternalLoginListViewModel - { - public string ReturnUrl { get; set; } - } - - public class SendCodeViewModel - { - public string SelectedProvider { get; set; } - public ICollection Providers { get; set; } - public string ReturnUrl { get; set; } - public bool RememberMe { get; set; } - } - - public class VerifyCodeViewModel - { - [Required] - public string Provider { get; set; } - - [Required] - [Display(Name = "Code")] - public string Code { get; set; } - public string ReturnUrl { get; set; } - - [Display(Name = "Remember this browser?")] - public bool RememberBrowser { get; set; } - - public bool RememberMe { get; set; } - } - - public class ForgotViewModel - { - [Required] - [Display(Name = "Email")] - public string Email { get; set; } - } - - public class LoginViewModel - { - [Required] - [Display(Name = "Email")] - [EmailAddress] - public string Email { get; set; } - - [Required] - [DataType(DataType.Password)] - [Display(Name = "Password")] - public string Password { get; set; } - - [Display(Name = "Remember me?")] - public bool RememberMe { get; set; } - - } - - public class RegisterViewModel - { - [Required] - [EmailAddress] - [Display(Name = "Email")] - public string Email { get; set; } - - [Required] - [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)] - [DataType(DataType.Password)] - [Display(Name = "Password")] - public string Password { get; set; } - - [DataType(DataType.Password)] - [Display(Name = "Confirm password")] - [Compare("Password", ErrorMessage = "The password and confirmation password do not match.")] - public string ConfirmPassword { get; set; } - } - - public class ResetPasswordViewModel - { - [Required] - [EmailAddress] - [Display(Name = "Email")] - public string Email { get; set; } - - [Required] - [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)] - [DataType(DataType.Password)] - [Display(Name = "Password")] - public string Password { get; set; } - - [DataType(DataType.Password)] - [Display(Name = "Confirm password")] - [Compare("Password", ErrorMessage = "The password and confirmation password do not match.")] - public string ConfirmPassword { get; set; } - - public string Code { get; set; } - } - - public class ForgotPasswordViewModel - { - [Required] - [EmailAddress] - [Display(Name = "Email")] - public string Email { get; set; } - } -} diff --git a/AspNet4/Mvc/AdhocReportingMetaData/Models/ApplicationUser.cs b/AspNet4/Mvc/AdhocReportingMetaData/Models/ApplicationUser.cs index 2695f02d..ef6ecbc1 100644 --- a/AspNet4/Mvc/AdhocReportingMetaData/Models/ApplicationUser.cs +++ b/AspNet4/Mvc/AdhocReportingMetaData/Models/ApplicationUser.cs @@ -1,21 +1,9 @@ -using System.Data.Entity; -using System.Security.Claims; -using System.Threading.Tasks; -using Microsoft.AspNet.Identity; -using Microsoft.AspNet.Identity.EntityFramework; +using Microsoft.AspNetCore.Identity; namespace EqDemo.Models { - // You can add profile data for the user by adding more properties to your ApplicationUser class, please visit https://go.microsoft.com/fwlink/?LinkID=317594 to learn more. public class ApplicationUser : IdentityUser { - public async Task GenerateUserIdentityAsync(UserManager manager) - { - // Note the authenticationType must match the one defined in CookieAuthenticationOptions.AuthenticationType - var userIdentity = await manager.CreateIdentityAsync(this, DefaultAuthenticationTypes.ApplicationCookie); - // Add custom user claims here - return userIdentity; - } } -} \ No newline at end of file +} diff --git a/AspNet4/Mvc/AdhocReportingMetaData/Models/IdentityModels.cs b/AspNet4/Mvc/AdhocReportingMetaData/Models/IdentityModels.cs deleted file mode 100644 index 21299219..00000000 --- a/AspNet4/Mvc/AdhocReportingMetaData/Models/IdentityModels.cs +++ /dev/null @@ -1,76 +0,0 @@ -using System.Data.Entity; -using System.Security.Claims; -using System.Threading.Tasks; -using Microsoft.AspNet.Identity; -using Microsoft.AspNet.Identity.EntityFramework; - -namespace EqAspNet4Demo.Models -{ - // You can add profile data for the user by adding more properties to your ApplicationUser class, please visit https://go.microsoft.com/fwlink/?LinkID=317594 to learn more. - public class ApplicationUser : IdentityUser - { - public async Task GenerateUserIdentityAsync(UserManager manager) - { - // Note the authenticationType must match the one defined in CookieAuthenticationOptions.AuthenticationType - var userIdentity = await manager.CreateIdentityAsync(this, DefaultAuthenticationTypes.ApplicationCookie); - // Add custom user claims here - return userIdentity; - } - } - - public class ApplicationDbContext : IdentityDbContext - { - public ApplicationDbContext() - : base("DefaultConnection", throwIfV1Schema: false) - { - Database.SetInitializer(new NwindInitializer()); - } - - - - #region NWind - public DbSet Categories { get; set; } - - public DbSet Customers { get; set; } - - public DbSet Employees { get; set; } - - public DbSet Orders { get; set; } - - public DbSet Products { get; set; } - - public DbSet OrderDetails { get; set; } - - public DbSet Shippers { get; set; } - - public DbSet Suppliers { get; set; } - - #endregion - - protected override void OnModelCreating(DbModelBuilder modelBuilder) - { - base.OnModelCreating(modelBuilder); - - modelBuilder.Entity() - .ToTable("Order_Details") - .HasKey(od => new { od.OrderID, od.ProductID }); - } - - public static ApplicationDbContext Create() - { - return new ApplicationDbContext(); - } - - } - - public class NwindInitializer : CreateDatabaseIfNotExists - { - protected override void Seed(ApplicationDbContext context) - { - base.Seed(context); - - var initializer = new DbIntializer(context.Database.Connection.ConnectionString); - initializer.AddTestData(); - } - } -} \ No newline at end of file diff --git a/AspNet4/Mvc/AdhocReportingMetaData/Models/ManageViewModels.cs b/AspNet4/Mvc/AdhocReportingMetaData/Models/ManageViewModels.cs deleted file mode 100644 index 265c15b3..00000000 --- a/AspNet4/Mvc/AdhocReportingMetaData/Models/ManageViewModels.cs +++ /dev/null @@ -1,86 +0,0 @@ -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using Microsoft.AspNet.Identity; -using Microsoft.Owin.Security; - -namespace EqDemo.Models -{ - public class IndexViewModel - { - public bool HasPassword { get; set; } - public IList Logins { get; set; } - public string PhoneNumber { get; set; } - public bool TwoFactor { get; set; } - public bool BrowserRemembered { get; set; } - } - - public class ManageLoginsViewModel - { - public IList CurrentLogins { get; set; } - public IList OtherLogins { get; set; } - } - - public class FactorViewModel - { - public string Purpose { get; set; } - } - - public class SetPasswordViewModel - { - [Required] - [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)] - [DataType(DataType.Password)] - [Display(Name = "New password")] - public string NewPassword { get; set; } - - [DataType(DataType.Password)] - [Display(Name = "Confirm new password")] - [Compare("NewPassword", ErrorMessage = "The new password and confirmation password do not match.")] - public string ConfirmPassword { get; set; } - } - - public class ChangePasswordViewModel - { - [Required] - [DataType(DataType.Password)] - [Display(Name = "Current password")] - public string OldPassword { get; set; } - - [Required] - [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)] - [DataType(DataType.Password)] - [Display(Name = "New password")] - public string NewPassword { get; set; } - - [DataType(DataType.Password)] - [Display(Name = "Confirm new password")] - [Compare("NewPassword", ErrorMessage = "The new password and confirmation password do not match.")] - public string ConfirmPassword { get; set; } - } - - public class AddPhoneNumberViewModel - { - [Required] - [Phone] - [Display(Name = "Phone Number")] - public string Number { get; set; } - } - - public class VerifyPhoneNumberViewModel - { - [Required] - [Display(Name = "Code")] - public string Code { get; set; } - - [Required] - [Phone] - [Display(Name = "Phone Number")] - public string PhoneNumber { get; set; } - } - - public class ConfigureTwoFactorViewModel - { - public string SelectedProvider { get; set; } - public ICollection Providers { get; set; } - } -} \ No newline at end of file diff --git a/AspNet4/Mvc/AdhocReportingMetaData/Models/Report.cs b/AspNet4/Mvc/AdhocReportingMetaData/Models/Report.cs index 3fa570d4..9c8d2f4a 100644 --- a/AspNet4/Mvc/AdhocReportingMetaData/Models/Report.cs +++ b/AspNet4/Mvc/AdhocReportingMetaData/Models/Report.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNet.Identity.EntityFramework; +using Microsoft.AspNetCore.Identity; namespace EqDemo.Models { @@ -18,4 +18,4 @@ public class Report public IdentityUser Owner { get; set; } } -} \ No newline at end of file +} diff --git a/AspNet4/Mvc/AdhocReportingMetaData/Program.cs b/AspNet4/Mvc/AdhocReportingMetaData/Program.cs new file mode 100644 index 00000000..83414752 --- /dev/null +++ b/AspNet4/Mvc/AdhocReportingMetaData/Program.cs @@ -0,0 +1,20 @@ +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Hosting; + +namespace EqDemo +{ + public class Program + { + public static void Main(string[] args) + { + CreateHostBuilder(args).Build().Run(); + } + + public static IHostBuilder CreateHostBuilder(string[] args) => + Host.CreateDefaultBuilder(args) + .ConfigureWebHostDefaults(webBuilder => + { + webBuilder.UseStartup(); + }); + } +} diff --git a/AspNet4/Mvc/AdhocReportingMetaData/Properties/AssemblyInfo.cs b/AspNet4/Mvc/AdhocReportingMetaData/Properties/AssemblyInfo.cs deleted file mode 100644 index fb52268c..00000000 --- a/AspNet4/Mvc/AdhocReportingMetaData/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("EqDemo.AspNet4x.AdhocReporting")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("EqDemo.AspNet4x.AdhocReporting")] -[assembly: AssemblyCopyright("Copyright © 2019")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("30fa8735-d1bd-4cb0-8237-c6485e7d406b")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/AspNet4/Mvc/AdhocReportingMetaData/Services/DefaultReportGenerator.cs b/AspNet4/Mvc/AdhocReportingMetaData/Services/DefaultReportGenerator.cs index 750ba929..5a777999 100644 --- a/AspNet4/Mvc/AdhocReportingMetaData/Services/DefaultReportGenerator.cs +++ b/AspNet4/Mvc/AdhocReportingMetaData/Services/DefaultReportGenerator.cs @@ -1,8 +1,8 @@ -using System; +using System; using System.Collections.Generic; using System.IO; -using Microsoft.AspNet.Identity.EntityFramework; +using Microsoft.AspNetCore.Identity; using Newtonsoft.Json.Linq; @@ -17,10 +17,10 @@ public class DefaultReportGenerator private const string _modelId = "adhoc-reporting"; - public DefaultReportGenerator(ApplicationDbContext dbContext) + public DefaultReportGenerator(ApplicationDbContext dbContext, string dataPath) { _dbContext = dbContext; - _dataPath = Path.Combine(System.Web.Hosting.HostingEnvironment.MapPath("~/App_Data"), "Seed"); + _dataPath = Path.Combine(dataPath, "Seed"); } public void Generate(IdentityUser user) @@ -45,7 +45,6 @@ public void Generate(IdentityUser user) } _dbContext.SaveChanges(); - } private IEnumerable GetReportJsons() @@ -57,4 +56,4 @@ private IEnumerable GetReportJsons() } } } -} \ No newline at end of file +} diff --git a/AspNet4/Mvc/AdhocReportingMetaData/Services/EqSessionCachingService.cs b/AspNet4/Mvc/AdhocReportingMetaData/Services/EqSessionCachingService.cs index c2de589d..34951645 100644 --- a/AspNet4/Mvc/AdhocReportingMetaData/Services/EqSessionCachingService.cs +++ b/AspNet4/Mvc/AdhocReportingMetaData/Services/EqSessionCachingService.cs @@ -1,6 +1,4 @@ -using System; -using System.Web; -using System.Web.SessionState; +using Microsoft.AspNetCore.Http; using Korzh.EasyQuery.Services; @@ -8,24 +6,21 @@ namespace EqDemo.Services { public class EqSessionCachingService : IEqCachingService { - /// - /// An instance of session object - /// - protected readonly HttpSessionState Session; + protected readonly ISession Session; - public EqSessionCachingService() + public EqSessionCachingService(IHttpContextAccessor httpContextAccessor) { - Session = HttpContext.Current.Session; + Session = httpContextAccessor.HttpContext.Session; } public string GetValue(string key) { - return (string)Session[key]; + return Session.GetString(key); } public void PutValue(string key, string value) { - Session[key] = value; + Session.SetString(key, value); } } } diff --git a/AspNet4/Mvc/AdhocReportingMetaData/Services/ReportStore.cs b/AspNet4/Mvc/AdhocReportingMetaData/Services/ReportStore.cs index d8fbc3f5..00ff2355 100644 --- a/AspNet4/Mvc/AdhocReportingMetaData/Services/ReportStore.cs +++ b/AspNet4/Mvc/AdhocReportingMetaData/Services/ReportStore.cs @@ -1,17 +1,17 @@ -using System; +using System; +using System.Security.Claims; using System.Security.Principal; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; -using System.Data.Entity; +using System.Threading; -using Microsoft.AspNet.Identity; +using Microsoft.EntityFrameworkCore; using Korzh.EasyQuery; using Korzh.EasyQuery.Services; using EqDemo.Models; -using System.Threading; namespace EqDemo.Services { @@ -31,31 +31,28 @@ public ReportStore(ApplicationDbContext dbContext, IPrincipal user) public async Task AddQueryAsync(Query query, CancellationToken ct = default) { - if (string.IsNullOrEmpty(query.Id)) - { + if (string.IsNullOrEmpty(query.Id)) { query.Id = Guid.NewGuid().ToString(); } - var report = new Report - { + var userId = (User?.Identity as ClaimsIdentity)?.FindFirst(ClaimTypes.NameIdentifier)?.Value; + + var report = new Report { Id = query.Id, Name = query.Name, Description = query.Description, ModelId = query.Model.Id, QueryJson = await query.SaveToJsonStringAsync(), - OwnerId = User?.Identity.GetUserId() + OwnerId = userId }; - - if (report.OwnerId == null) - { + if (report.OwnerId == null) { throw new ArgumentNullException(nameof(report.OwnerId)); } DbContext.Reports.Add(report); await DbContext.SaveChangesAsync(ct); return true; - } public async Task> GetAllQueriesAsync(string modelId, CancellationToken ct = default) @@ -64,11 +61,9 @@ public async Task> GetAllQueriesAsync(string modelId, .Where(r => r.ModelId == modelId) .ToListAsync(ct); - return reports.Select(r => new QueryListItem(r.Id, r.Name, r.Description)).ToList(); + return reports.Select(r => new QueryListItem(r.Id, r.ModelId, r.Name, r.Description)).ToList(); } - - public async Task LoadQueryAsync(Query query, string queryId, CancellationToken ct = default) { var report = await ApplyUserGuard(DbContext.Reports).FirstOrDefaultAsync(r => r.Id == queryId, ct); @@ -76,53 +71,44 @@ public async Task LoadQueryAsync(Query query, string queryId, Cancellation { await query.LoadFromJsonStringAsync(report.QueryJson, ct); query.Id = report.Id; - return true; } - return false; } public async Task RemoveQueryAsync(string modelId, string queryId, CancellationToken ct = default) { var report = await ApplyUserGuard(DbContext.Reports).FirstOrDefaultAsync(r => r.Id == queryId, ct); - if (report != null) - { + if (report != null) { DbContext.Reports.Remove(report); await DbContext.SaveChangesAsync(); - return true; } - return false; } public async Task SaveQueryAsync(Query query, bool createIfNotExist = true, CancellationToken ct = default) { var report = await ApplyUserGuard(DbContext.Reports).FirstOrDefaultAsync(r => r.Id == query.Id, ct); - if (report != null) - { + if (report != null) { report.Name = query.Name; report.Description = query.Description; report.ModelId = query.Model.Id; report.QueryJson = await query.SaveToJsonStringAsync(); - await DbContext.SaveChangesAsync(); - return true; } else if (createIfNotExist) { return await AddQueryAsync(query, ct); } - return false; } private IQueryable ApplyUserGuard(IQueryable filter) { - var userId = User?.Identity.GetUserId(); + var userId = (User?.Identity as ClaimsIdentity)?.FindFirst(ClaimTypes.NameIdentifier)?.Value; return filter.Where(r => r.OwnerId == userId); } } -} \ No newline at end of file +} diff --git a/AspNet4/Mvc/AdhocReportingMetaData/Startup.cs b/AspNet4/Mvc/AdhocReportingMetaData/Startup.cs index 392d619c..a075e94e 100644 --- a/AspNet4/Mvc/AdhocReportingMetaData/Startup.cs +++ b/AspNet4/Mvc/AdhocReportingMetaData/Startup.cs @@ -1,24 +1,95 @@ -using Microsoft.Owin; -using Owin; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.AspNetCore.Identity; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; -using System.Data.Entity.Migrations; +using Korzh.EasyQuery.Services; +using Korzh.EasyQuery.Db; -using EqDemo.Migrations; +using EqDemo.Models; +using EqDemo.Services; -[assembly: OwinStartupAttribute(typeof(EqDemo.Startup))] namespace EqDemo { - public partial class Startup + public class Startup { - public void Configuration(IAppBuilder app) + public Startup(IConfiguration configuration) { - ConfigureAuth(app); + Configuration = configuration; + DbConnectionString = Configuration.GetConnectionString("DefaultConnection"); + } + + public IConfiguration Configuration { get; } + public string DbConnectionString { get; } + + public void ConfigureServices(IServiceCollection services) + { + services.AddDbContext( + options => options.UseSqlServer(DbConnectionString) + ); + + services.AddIdentity(options => { + options.SignIn.RequireConfirmedAccount = false; + }) + .AddEntityFrameworkStores(); + + services.AddDistributedMemoryCache(); + services.AddSession(); + + services.AddEasyQuery() + .UseSqlManager() + .AddDefaultExporters() + .RegisterDbGate(); + + services.AddControllersWithViews(); + services.AddRazorPages(); + } + + public void Configure(IApplicationBuilder app, IWebHostEnvironment env) + { + if (env.IsDevelopment()) { + app.UseDeveloperExceptionPage(); + } + else { + app.UseExceptionHandler("/Home/Error"); + app.UseHsts(); + } + + app.UseHttpsRedirection(); + app.UseStaticFiles(); + app.UseRouting(); + + app.UseAuthentication(); + app.UseAuthorization(); + app.UseSession(); - var databaseMigrator = new DbMigrator(new Configuration()); - databaseMigrator.Update(); + app.UseEndpoints(endpoints => { + endpoints.MapEasyQuery(options => { + options.DefaultModelId = "adhoc-reporting"; + options.StoreModelInCache = true; + options.StoreQueryInCache = true; + options.SaveNewQuery = true; + options.ConnectionString = DbConnectionString; + options.UseDbContext(); + options.UseDbConnectionModelLoader(settings => { + settings.AddTableFilter(tbl => !tbl.Name.StartsWith("sys")); + settings.AddFieldFilter(fld => !fld.IsForeignKey); + settings.AddFieldFilter(fld => { + if (fld.Name == "CompanyName") fld.Name = "Customer Name"; + return true; + }); + }); + options.UseQueryStore((_) => new FileQueryStore("App_Data")); + }); - IdentityHelper.SeedEqManagerRole(); - IdentityHelper.SeedDefaultUser(); + endpoints.MapControllerRoute( + name: "default", + pattern: "{controller=Home}/{action=Index}/{id?}"); + endpoints.MapRazorPages(); + }); } } } diff --git a/AspNet4/Mvc/AdhocReportingMetaData/Views/Account/ConfirmEmail.cshtml b/AspNet4/Mvc/AdhocReportingMetaData/Views/Account/ConfirmEmail.cshtml deleted file mode 100644 index ecbf143b..00000000 --- a/AspNet4/Mvc/AdhocReportingMetaData/Views/Account/ConfirmEmail.cshtml +++ /dev/null @@ -1,10 +0,0 @@ -@{ - ViewBag.Title = "Confirm Email"; -} - -

@ViewBag.Title.

-
-

- Thank you for confirming your email. Please @Html.ActionLink("Click here to Log in", "Login", "Account", routeValues: null, htmlAttributes: new { id = "loginLink" }) -

-
diff --git a/AspNet4/Mvc/AdhocReportingMetaData/Views/Account/ExternalLoginConfirmation.cshtml b/AspNet4/Mvc/AdhocReportingMetaData/Views/Account/ExternalLoginConfirmation.cshtml deleted file mode 100644 index b0de1981..00000000 --- a/AspNet4/Mvc/AdhocReportingMetaData/Views/Account/ExternalLoginConfirmation.cshtml +++ /dev/null @@ -1,36 +0,0 @@ -@model EqDemo.Models.ExternalLoginConfirmationViewModel -@{ - ViewBag.Title = "Register"; -} -

@ViewBag.Title.

-

Associate your @ViewBag.LoginProvider account.

- -@using (Html.BeginForm("ExternalLoginConfirmation", "Account", new { ReturnUrl = ViewBag.ReturnUrl }, FormMethod.Post, new { @class = "form-horizontal", role = "form" })) -{ - @Html.AntiForgeryToken() - -

Association Form

-
- @Html.ValidationSummary(true, "", new { @class = "text-danger" }) -

- You've successfully authenticated with @ViewBag.LoginProvider. - Please enter a user name for this site below and click the Register button to finish - logging in. -

-
- @Html.LabelFor(m => m.Email, new { @class = "col-md-2 control-label" }) -
- @Html.TextBoxFor(m => m.Email, new { @class = "form-control" }) - @Html.ValidationMessageFor(m => m.Email, "", new { @class = "text-danger" }) -
-
-
-
- -
-
-} - -@section Scripts { - @Scripts.Render("~/bundles/jqueryval") -} diff --git a/AspNet4/Mvc/AdhocReportingMetaData/Views/Account/ExternalLoginFailure.cshtml b/AspNet4/Mvc/AdhocReportingMetaData/Views/Account/ExternalLoginFailure.cshtml deleted file mode 100644 index 4ad6a858..00000000 --- a/AspNet4/Mvc/AdhocReportingMetaData/Views/Account/ExternalLoginFailure.cshtml +++ /dev/null @@ -1,8 +0,0 @@ -@{ - ViewBag.Title = "Login Failure"; -} - -
-

@ViewBag.Title.

-

Unsuccessful login with service.

-
diff --git a/AspNet4/Mvc/AdhocReportingMetaData/Views/Account/ForgotPassword.cshtml b/AspNet4/Mvc/AdhocReportingMetaData/Views/Account/ForgotPassword.cshtml deleted file mode 100644 index 8298c2d1..00000000 --- a/AspNet4/Mvc/AdhocReportingMetaData/Views/Account/ForgotPassword.cshtml +++ /dev/null @@ -1,29 +0,0 @@ -@model EqDemo.Models.ForgotPasswordViewModel -@{ - ViewBag.Title = "Forgot your password?"; -} - -

@ViewBag.Title.

- -@using (Html.BeginForm("ForgotPassword", "Account", FormMethod.Post, new { @class = "form-horizontal", role = "form" })) -{ - @Html.AntiForgeryToken() -

Enter your email.

-
- @Html.ValidationSummary("", new { @class = "text-danger" }) -
- @Html.LabelFor(m => m.Email, new { @class = "col-md-2 control-label" }) -
- @Html.TextBoxFor(m => m.Email, new { @class = "form-control" }) -
-
-
-
- -
-
-} - -@section Scripts { - @Scripts.Render("~/bundles/jqueryval") -} diff --git a/AspNet4/Mvc/AdhocReportingMetaData/Views/Account/ForgotPasswordConfirmation.cshtml b/AspNet4/Mvc/AdhocReportingMetaData/Views/Account/ForgotPasswordConfirmation.cshtml deleted file mode 100644 index f48c41b8..00000000 --- a/AspNet4/Mvc/AdhocReportingMetaData/Views/Account/ForgotPasswordConfirmation.cshtml +++ /dev/null @@ -1,13 +0,0 @@ -@{ - ViewBag.Title = "Forgot Password Confirmation"; -} - -
-

@ViewBag.Title.

-
-
-

- Please check your email to reset your password. -

-
- diff --git a/AspNet4/Mvc/AdhocReportingMetaData/Views/Account/Login.cshtml b/AspNet4/Mvc/AdhocReportingMetaData/Views/Account/Login.cshtml deleted file mode 100644 index 7a9aa1dd..00000000 --- a/AspNet4/Mvc/AdhocReportingMetaData/Views/Account/Login.cshtml +++ /dev/null @@ -1,87 +0,0 @@ -@using EqDemo.Models -@model LoginViewModel -@{ - ViewBag.Title = "Log in"; - - ViewData["Title"] = "Log in"; - ViewData["MenuTitle"] = "Menu"; - - const string defaultUserEmail = "demo@korzh.com"; - const string defaultUserPassword = "demo"; -} - -
-

@ViewBag.Title.

-
-
-
- @using (Html.BeginForm("Login", "Account", new { ReturnUrl = ViewBag.ReturnUrl }, FormMethod.Post, new { @class = "form-horizontal", role = "form" })) - { - @Html.AntiForgeryToken() -

Use a local account to log in.

-
- @Html.ValidationSummary(true, "", new { @class = "text-danger" }) -
- @Html.LabelFor(m => m.Email, new { @class = "col-md-2 control-label" }) -
- @Html.TextBoxFor(m => m.Email, new { @class = "form-control", @Value = defaultUserEmail }) - @Html.ValidationMessageFor(m => m.Email, "", new { @class = "text-danger" }) -
-
-
- @Html.LabelFor(m => m.Password, new { @class = "col-md-2 control-label" }) -
- @Html.PasswordFor(m => m.Password, new { @class = "form-control", @value = defaultUserPassword }) - @Html.ValidationMessageFor(m => m.Password, "", new { @class = "text-danger" }) -
-
-
-
-
- @Html.CheckBoxFor(m => m.RememberMe) - @Html.LabelFor(m => m.RememberMe) -
-
-
-
-
- -
-
-

- @Html.ActionLink("Register as a new user", "Register", new { ReturnUrl = ViewBag.ReturnUrl }) -

-

- @Html.ActionLink("Forgot your password?", "ForgotPassword") -

- } -
-
-
-
-

Demo account

-
-
-

- Some pages of our demo application require an authorization. - We did that by purpose - to demonstrate how EasyQuery works in the systems with access control. -

- To login you might use the default user with the following credentials: -

-

- login: demo@korzh.com -
- password: demo -

-

- or you can @Html.ActionLink("register a new account", "Register", new { ReturnUrl = ViewBag.ReturnUrl }) and unleash all possibilities of this demo. -

-
-
-
-
-
- -@section Scripts { - @Scripts.Render("~/bundles/jqueryval") -} diff --git a/AspNet4/Mvc/AdhocReportingMetaData/Views/Account/Register.cshtml b/AspNet4/Mvc/AdhocReportingMetaData/Views/Account/Register.cshtml deleted file mode 100644 index e453f9d1..00000000 --- a/AspNet4/Mvc/AdhocReportingMetaData/Views/Account/Register.cshtml +++ /dev/null @@ -1,43 +0,0 @@ -@model EqDemo.Models.RegisterViewModel -@{ - ViewBag.Title = "Register"; -} - -
-

@ViewBag.Title.

- -@using (Html.BeginForm("Register", "Account", new { returnUrl = ViewBag.ReturnUrl }, FormMethod.Post, new { @class = "form-horizontal", role = "form" })) -{ - @Html.AntiForgeryToken() -

Create a new account.

-
- @Html.ValidationSummary("", new { @class = "text-danger" }) -
- @Html.LabelFor(m => m.Email, new { @class = "col-md-2 control-label" }) -
- @Html.TextBoxFor(m => m.Email, new { @class = "form-control" }) -
-
-
- @Html.LabelFor(m => m.Password, new { @class = "col-md-2 control-label" }) -
- @Html.PasswordFor(m => m.Password, new { @class = "form-control" }) -
-
-
- @Html.LabelFor(m => m.ConfirmPassword, new { @class = "col-md-2 control-label" }) -
- @Html.PasswordFor(m => m.ConfirmPassword, new { @class = "form-control" }) -
-
-
-
- -
-
-} -
- -@section Scripts { - @Scripts.Render("~/bundles/jqueryval") -} diff --git a/AspNet4/Mvc/AdhocReportingMetaData/Views/Account/ResetPassword.cshtml b/AspNet4/Mvc/AdhocReportingMetaData/Views/Account/ResetPassword.cshtml deleted file mode 100644 index 87338427..00000000 --- a/AspNet4/Mvc/AdhocReportingMetaData/Views/Account/ResetPassword.cshtml +++ /dev/null @@ -1,42 +0,0 @@ -@model EqDemo.Models.ResetPasswordViewModel -@{ - ViewBag.Title = "Reset password"; -} - -

@ViewBag.Title.

- -@using (Html.BeginForm("ResetPassword", "Account", FormMethod.Post, new { @class = "form-horizontal", role = "form" })) -{ - @Html.AntiForgeryToken() -

Reset your password.

-
- @Html.ValidationSummary("", new { @class = "text-danger" }) - @Html.HiddenFor(model => model.Code) -
- @Html.LabelFor(m => m.Email, new { @class = "col-md-2 control-label" }) -
- @Html.TextBoxFor(m => m.Email, new { @class = "form-control" }) -
-
-
- @Html.LabelFor(m => m.Password, new { @class = "col-md-2 control-label" }) -
- @Html.PasswordFor(m => m.Password, new { @class = "form-control" }) -
-
-
- @Html.LabelFor(m => m.ConfirmPassword, new { @class = "col-md-2 control-label" }) -
- @Html.PasswordFor(m => m.ConfirmPassword, new { @class = "form-control" }) -
-
-
-
- -
-
-} - -@section Scripts { - @Scripts.Render("~/bundles/jqueryval") -} diff --git a/AspNet4/Mvc/AdhocReportingMetaData/Views/Account/ResetPasswordConfirmation.cshtml b/AspNet4/Mvc/AdhocReportingMetaData/Views/Account/ResetPasswordConfirmation.cshtml deleted file mode 100644 index d8a4b3ba..00000000 --- a/AspNet4/Mvc/AdhocReportingMetaData/Views/Account/ResetPasswordConfirmation.cshtml +++ /dev/null @@ -1,12 +0,0 @@ -@{ - ViewBag.Title = "Reset password confirmation"; -} - -
-

@ViewBag.Title.

-
-
-

- Your password has been reset. Please @Html.ActionLink("click here to log in", "Login", "Account", routeValues: null, htmlAttributes: new { id = "loginLink" }) -

-
diff --git a/AspNet4/Mvc/AdhocReportingMetaData/Views/Account/SendCode.cshtml b/AspNet4/Mvc/AdhocReportingMetaData/Views/Account/SendCode.cshtml deleted file mode 100644 index 0680d7c4..00000000 --- a/AspNet4/Mvc/AdhocReportingMetaData/Views/Account/SendCode.cshtml +++ /dev/null @@ -1,24 +0,0 @@ -@model EqDemo.Models.SendCodeViewModel -@{ - ViewBag.Title = "Send"; -} - -

@ViewBag.Title.

- -@using (Html.BeginForm("SendCode", "Account", new { ReturnUrl = Model.ReturnUrl }, FormMethod.Post, new { @class = "form-horizontal", role = "form" })) { - @Html.AntiForgeryToken() - @Html.Hidden("rememberMe", @Model.RememberMe) -

Send verification code

-
-
-
- Select Two-Factor Authentication Provider: - @Html.DropDownListFor(model => model.SelectedProvider, Model.Providers) - -
-
-} - -@section Scripts { - @Scripts.Render("~/bundles/jqueryval") -} diff --git a/AspNet4/Mvc/AdhocReportingMetaData/Views/Account/VerifyCode.cshtml b/AspNet4/Mvc/AdhocReportingMetaData/Views/Account/VerifyCode.cshtml deleted file mode 100644 index a4f659fc..00000000 --- a/AspNet4/Mvc/AdhocReportingMetaData/Views/Account/VerifyCode.cshtml +++ /dev/null @@ -1,38 +0,0 @@ -@model EqDemo.Models.VerifyCodeViewModel -@{ - ViewBag.Title = "Verify"; -} - -

@ViewBag.Title.

- -@using (Html.BeginForm("VerifyCode", "Account", new { ReturnUrl = Model.ReturnUrl }, FormMethod.Post, new { @class = "form-horizontal", role = "form" })) { - @Html.AntiForgeryToken() - @Html.Hidden("provider", @Model.Provider) - @Html.Hidden("rememberMe", @Model.RememberMe) -

Enter verification code

-
- @Html.ValidationSummary("", new { @class = "text-danger" }) -
- @Html.LabelFor(m => m.Code, new { @class = "col-md-2 control-label" }) -
- @Html.TextBoxFor(m => m.Code, new { @class = "form-control" }) -
-
-
-
-
- @Html.CheckBoxFor(m => m.RememberBrowser) - @Html.LabelFor(m => m.RememberBrowser) -
-
-
-
-
- -
-
-} - -@section Scripts { - @Scripts.Render("~/bundles/jqueryval") -} diff --git a/AspNet4/Mvc/AdhocReportingMetaData/Views/Account/_ExternalLoginsListPartial.cshtml b/AspNet4/Mvc/AdhocReportingMetaData/Views/Account/_ExternalLoginsListPartial.cshtml deleted file mode 100644 index e9200032..00000000 --- a/AspNet4/Mvc/AdhocReportingMetaData/Views/Account/_ExternalLoginsListPartial.cshtml +++ /dev/null @@ -1,28 +0,0 @@ -@model EqDemo.Models.ExternalLoginListViewModel -@using Microsoft.Owin.Security - -

Use another service to log in.

-
-@{ - var loginProviders = Context.GetOwinContext().Authentication.GetExternalAuthenticationTypes(); - if (loginProviders.Count() == 0) { -
-

- There are no external authentication services configured. See this article - for details on setting up this ASP.NET application to support logging in via external services. -

-
- } - else { - using (Html.BeginForm("ExternalLogin", "Account", new { ReturnUrl = Model.ReturnUrl })) { - @Html.AntiForgeryToken() -
-

- @foreach (AuthenticationDescription p in loginProviders) { - - } -

-
- } - } -} diff --git a/AspNet4/Mvc/AdhocReportingMetaData/Views/Manage/AddPhoneNumber.cshtml b/AspNet4/Mvc/AdhocReportingMetaData/Views/Manage/AddPhoneNumber.cshtml deleted file mode 100644 index 6a5613ed..00000000 --- a/AspNet4/Mvc/AdhocReportingMetaData/Views/Manage/AddPhoneNumber.cshtml +++ /dev/null @@ -1,29 +0,0 @@ -@model EqDemo.Models.AddPhoneNumberViewModel -@{ - ViewBag.Title = "Phone Number"; -} - -

@ViewBag.Title.

- -@using (Html.BeginForm("AddPhoneNumber", "Manage", FormMethod.Post, new { @class = "form-horizontal", role = "form" })) -{ - @Html.AntiForgeryToken() -

Add a phone number

-
- @Html.ValidationSummary("", new { @class = "text-danger" }) -
- @Html.LabelFor(m => m.Number, new { @class = "col-md-2 control-label" }) -
- @Html.TextBoxFor(m => m.Number, new { @class = "form-control" }) -
-
-
-
- -
-
-} - -@section Scripts { - @Scripts.Render("~/bundles/jqueryval") -} diff --git a/AspNet4/Mvc/AdhocReportingMetaData/Views/Manage/ChangePassword.cshtml b/AspNet4/Mvc/AdhocReportingMetaData/Views/Manage/ChangePassword.cshtml deleted file mode 100644 index eb272cb9..00000000 --- a/AspNet4/Mvc/AdhocReportingMetaData/Views/Manage/ChangePassword.cshtml +++ /dev/null @@ -1,40 +0,0 @@ -@model EqDemo.Models.ChangePasswordViewModel -@{ - ViewBag.Title = "Change Password"; -} - -

@ViewBag.Title.

- -@using (Html.BeginForm("ChangePassword", "Manage", FormMethod.Post, new { @class = "form-horizontal", role = "form" })) -{ - @Html.AntiForgeryToken() -

Change Password Form

-
- @Html.ValidationSummary("", new { @class = "text-danger" }) -
- @Html.LabelFor(m => m.OldPassword, new { @class = "col-md-2 control-label" }) -
- @Html.PasswordFor(m => m.OldPassword, new { @class = "form-control" }) -
-
-
- @Html.LabelFor(m => m.NewPassword, new { @class = "col-md-2 control-label" }) -
- @Html.PasswordFor(m => m.NewPassword, new { @class = "form-control" }) -
-
-
- @Html.LabelFor(m => m.ConfirmPassword, new { @class = "col-md-2 control-label" }) -
- @Html.PasswordFor(m => m.ConfirmPassword, new { @class = "form-control" }) -
-
-
-
- -
-
-} -@section Scripts { - @Scripts.Render("~/bundles/jqueryval") -} diff --git a/AspNet4/Mvc/AdhocReportingMetaData/Views/Manage/Index.cshtml b/AspNet4/Mvc/AdhocReportingMetaData/Views/Manage/Index.cshtml deleted file mode 100644 index 01edf4f2..00000000 --- a/AspNet4/Mvc/AdhocReportingMetaData/Views/Manage/Index.cshtml +++ /dev/null @@ -1,87 +0,0 @@ -@model EqDemo.Models.IndexViewModel -@{ - ViewBag.Title = "Manage"; -} - -

@ViewBag.Title.

- -

@ViewBag.StatusMessage

-
-

Change your account settings

-
-
-
Password:
-
- [ - @if (Model.HasPassword) - { - @Html.ActionLink("Change your password", "ChangePassword") - } - else - { - @Html.ActionLink("Create", "SetPassword") - } - ] -
-
External Logins:
-
- @Model.Logins.Count [ - @Html.ActionLink("Manage", "ManageLogins") ] -
- @* - Phone Numbers can used as a second factor of verification in a two-factor authentication system. - - See this article - for details on setting up this ASP.NET application to support two-factor authentication using SMS. - - Uncomment the following block after you have set up two-factor authentication - *@ - @* -
Phone Number:
-
- @(Model.PhoneNumber ?? "None") - @if (Model.PhoneNumber != null) - { -
- [  @Html.ActionLink("Change", "AddPhoneNumber")  ] - using (Html.BeginForm("RemovePhoneNumber", "Manage", FormMethod.Post, new { @class = "form-horizontal", role = "form" })) - { - @Html.AntiForgeryToken() - [] - } - } - else - { - [  @Html.ActionLink("Add", "AddPhoneNumber") - } -
- *@ -
Two-Factor Authentication:
-
-

- There are no two-factor authentication providers configured. See this article - for details on setting up this ASP.NET application to support two-factor authentication. -

- @*@if (Model.TwoFactor) - { - using (Html.BeginForm("DisableTwoFactorAuthentication", "Manage", FormMethod.Post, new { @class = "form-horizontal", role = "form" })) - { - @Html.AntiForgeryToken() - Enabled - - - } - } - else - { - using (Html.BeginForm("EnableTwoFactorAuthentication", "Manage", FormMethod.Post, new { @class = "form-horizontal", role = "form" })) - { - @Html.AntiForgeryToken() - Disabled - - - } - }*@ -
-
-
diff --git a/AspNet4/Mvc/AdhocReportingMetaData/Views/Manage/ManageLogins.cshtml b/AspNet4/Mvc/AdhocReportingMetaData/Views/Manage/ManageLogins.cshtml deleted file mode 100644 index 592228d4..00000000 --- a/AspNet4/Mvc/AdhocReportingMetaData/Views/Manage/ManageLogins.cshtml +++ /dev/null @@ -1,70 +0,0 @@ -@model EqDemo.Models.ManageLoginsViewModel -@using Microsoft.Owin.Security -@{ - ViewBag.Title = "Manage your external logins"; -} - -

@ViewBag.Title.

- -

@ViewBag.StatusMessage

-@{ - var loginProviders = Context.GetOwinContext().Authentication.GetExternalAuthenticationTypes(); - if (loginProviders.Count() == 0) { -
-

- There are no external authentication services configured. See this article - for details on setting up this ASP.NET application to support logging in via external services. -

-
- } - else - { - if (Model.CurrentLogins.Count > 0) - { -

Registered Logins

- - - @foreach (var account in Model.CurrentLogins) - { - - - - - } - -
@account.LoginProvider - @if (ViewBag.ShowRemoveButton) - { - using (Html.BeginForm("RemoveLogin", "Manage")) - { - @Html.AntiForgeryToken() -
- @Html.Hidden("loginProvider", account.LoginProvider) - @Html.Hidden("providerKey", account.ProviderKey) - -
- } - } - else - { - @:   - } -
- } - if (Model.OtherLogins.Count > 0) - { - using (Html.BeginForm("LinkLogin", "Manage")) - { - @Html.AntiForgeryToken() -
-

- @foreach (AuthenticationDescription p in Model.OtherLogins) - { - - } -

-
- } - } - } -} diff --git a/AspNet4/Mvc/AdhocReportingMetaData/Views/Manage/SetPassword.cshtml b/AspNet4/Mvc/AdhocReportingMetaData/Views/Manage/SetPassword.cshtml deleted file mode 100644 index e61789be..00000000 --- a/AspNet4/Mvc/AdhocReportingMetaData/Views/Manage/SetPassword.cshtml +++ /dev/null @@ -1,39 +0,0 @@ -@model EqDemo.Models.SetPasswordViewModel -@{ - ViewBag.Title = "Create Password"; -} - -

@ViewBag.Title.

-

- You do not have a local username/password for this site. Add a local - account so you can log in without an external login. -

- -@using (Html.BeginForm("SetPassword", "Manage", FormMethod.Post, new { @class = "form-horizontal", role = "form" })) -{ - @Html.AntiForgeryToken() - -

Create Local Login

-
- @Html.ValidationSummary("", new { @class = "text-danger" }) -
- @Html.LabelFor(m => m.NewPassword, new { @class = "col-md-2 control-label" }) -
- @Html.PasswordFor(m => m.NewPassword, new { @class = "form-control" }) -
-
-
- @Html.LabelFor(m => m.ConfirmPassword, new { @class = "col-md-2 control-label" }) -
- @Html.PasswordFor(m => m.ConfirmPassword, new { @class = "form-control" }) -
-
-
-
- -
-
-} -@section Scripts { - @Scripts.Render("~/bundles/jqueryval") -} diff --git a/AspNet4/Mvc/AdhocReportingMetaData/Views/Manage/VerifyPhoneNumber.cshtml b/AspNet4/Mvc/AdhocReportingMetaData/Views/Manage/VerifyPhoneNumber.cshtml deleted file mode 100644 index 09d09c32..00000000 --- a/AspNet4/Mvc/AdhocReportingMetaData/Views/Manage/VerifyPhoneNumber.cshtml +++ /dev/null @@ -1,31 +0,0 @@ -@model EqDemo.Models.VerifyPhoneNumberViewModel -@{ - ViewBag.Title = "Verify Phone Number"; -} - -

@ViewBag.Title.

- -@using (Html.BeginForm("VerifyPhoneNumber", "Manage", FormMethod.Post, new { @class = "form-horizontal", role = "form" })) -{ - @Html.AntiForgeryToken() - @Html.Hidden("phoneNumber", @Model.PhoneNumber) -

Enter verification code

-
@ViewBag.Status
-
- @Html.ValidationSummary("", new { @class = "text-danger" }) -
- @Html.LabelFor(m => m.Code, new { @class = "col-md-2 control-label" }) -
- @Html.TextBoxFor(m => m.Code, new { @class = "form-control" }) -
-
-
-
- -
-
-} - -@section Scripts { - @Scripts.Render("~/bundles/jqueryval") -} diff --git a/AspNet4/Mvc/AdhocReportingMetaData/Views/Shared/Error.cshtml b/AspNet4/Mvc/AdhocReportingMetaData/Views/Shared/Error.cshtml index 228b287f..b19d5537 100644 --- a/AspNet4/Mvc/AdhocReportingMetaData/Views/Shared/Error.cshtml +++ b/AspNet4/Mvc/AdhocReportingMetaData/Views/Shared/Error.cshtml @@ -1,9 +1,4 @@ -@model System.Web.Mvc.HandleErrorInfo - -@{ - ViewBag.Title = "Error"; -} +@{ ViewBag.Title = "Error"; }

Error.

An error occurred while processing your request.

- diff --git a/AspNet4/Mvc/AdhocReportingMetaData/Views/Shared/Lockout.cshtml b/AspNet4/Mvc/AdhocReportingMetaData/Views/Shared/Lockout.cshtml deleted file mode 100644 index e6e33ad7..00000000 --- a/AspNet4/Mvc/AdhocReportingMetaData/Views/Shared/Lockout.cshtml +++ /dev/null @@ -1,10 +0,0 @@ -@model System.Web.Mvc.HandleErrorInfo - -@{ - ViewBag.Title = "Locked Out"; -} - -
-

Locked out.

-

This account has been locked out, please try again later.

-
diff --git a/AspNet4/Mvc/AdhocReportingMetaData/Views/Shared/_LoginPartial.cshtml b/AspNet4/Mvc/AdhocReportingMetaData/Views/Shared/_LoginPartial.cshtml deleted file mode 100644 index c0f794e6..00000000 --- a/AspNet4/Mvc/AdhocReportingMetaData/Views/Shared/_LoginPartial.cshtml +++ /dev/null @@ -1,31 +0,0 @@ -@using Microsoft.AspNet.Identity - - diff --git a/AspNet4/Mvc/AdhocReportingMetaData/Views/Web.config b/AspNet4/Mvc/AdhocReportingMetaData/Views/Web.config deleted file mode 100644 index 83991b1c..00000000 --- a/AspNet4/Mvc/AdhocReportingMetaData/Views/Web.config +++ /dev/null @@ -1,51 +0,0 @@ - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/AspNet4/Mvc/AdhocReportingMetaData/Web.Debug.config b/AspNet4/Mvc/AdhocReportingMetaData/Web.Debug.config deleted file mode 100644 index d7712aaf..00000000 --- a/AspNet4/Mvc/AdhocReportingMetaData/Web.Debug.config +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - diff --git a/AspNet4/Mvc/AdhocReportingMetaData/Web.Release.config b/AspNet4/Mvc/AdhocReportingMetaData/Web.Release.config deleted file mode 100644 index 28a4d5fc..00000000 --- a/AspNet4/Mvc/AdhocReportingMetaData/Web.Release.config +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - diff --git a/AspNet4/Mvc/AdhocReportingMetaData/Web.config b/AspNet4/Mvc/AdhocReportingMetaData/Web.config deleted file mode 100644 index 238bf5ae..00000000 --- a/AspNet4/Mvc/AdhocReportingMetaData/Web.config +++ /dev/null @@ -1,348 +0,0 @@ - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/AspNet4/Mvc/AdhocReportingMetaData/appsettings.json b/AspNet4/Mvc/AdhocReportingMetaData/appsettings.json new file mode 100644 index 00000000..f9a6b346 --- /dev/null +++ b/AspNet4/Mvc/AdhocReportingMetaData/appsettings.json @@ -0,0 +1,14 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Warning" + } + }, + "AllowedHosts": "*", + "ConnectionStrings": { + "DefaultConnection": "Data Source=(localdb)\\MSSQLLocalDB;Initial Catalog=EqDemo.AspNet4x.AdhocReporting.MetaData;Integrated Security=True;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False" + }, + "EasyQuery": { + "LicenseKey": "" + } +} diff --git a/AspNet4/Mvc/AdvancedSearch-Multilayered/FrontApp/App_Start/BundleConfig.cs b/AspNet4/Mvc/AdvancedSearch-Multilayered/FrontApp/App_Start/BundleConfig.cs deleted file mode 100644 index 084eb023..00000000 --- a/AspNet4/Mvc/AdvancedSearch-Multilayered/FrontApp/App_Start/BundleConfig.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Web; -using System.Web.Optimization; - -namespace EqDemo.AspNet4x.AdvancedSearch -{ - public class BundleConfig - { - // For more information on bundling, visit https://go.microsoft.com/fwlink/?LinkId=301862 - public static void RegisterBundles(BundleCollection bundles) - { - } - } -} diff --git a/AspNet4/Mvc/AdvancedSearch-Multilayered/FrontApp/App_Start/FilterConfig.cs b/AspNet4/Mvc/AdvancedSearch-Multilayered/FrontApp/App_Start/FilterConfig.cs deleted file mode 100644 index 8897d3f4..00000000 --- a/AspNet4/Mvc/AdvancedSearch-Multilayered/FrontApp/App_Start/FilterConfig.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Web; -using System.Web.Mvc; - -namespace EqDemo.AspNet4x.AdvancedSearch -{ - public class FilterConfig - { - public static void RegisterGlobalFilters(GlobalFilterCollection filters) - { - filters.Add(new HandleErrorAttribute()); - } - } -} diff --git a/AspNet4/Mvc/AdvancedSearch-Multilayered/FrontApp/App_Start/RouteConfig.cs b/AspNet4/Mvc/AdvancedSearch-Multilayered/FrontApp/App_Start/RouteConfig.cs deleted file mode 100644 index 0bd6c97c..00000000 --- a/AspNet4/Mvc/AdvancedSearch-Multilayered/FrontApp/App_Start/RouteConfig.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web; -using System.Web.Mvc; -using System.Web.Routing; - -namespace EqDemo.AspNet4x.AdvancedSearch -{ - public class RouteConfig - { - public static void RegisterRoutes(RouteCollection routes) - { - routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); - - routes.MapMvcAttributeRoutes(); - - routes.MapRoute( - name: "Default", - url: "{controller}/{action}/{id}", - defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional } - ); - } - } -} diff --git a/AspNet4/Mvc/AdvancedSearch-Multilayered/FrontApp/Controllers/EqProxyController.cs b/AspNet4/Mvc/AdvancedSearch-Multilayered/FrontApp/Controllers/EqProxyController.cs index be2e8020..748745b1 100644 --- a/AspNet4/Mvc/AdvancedSearch-Multilayered/FrontApp/Controllers/EqProxyController.cs +++ b/AspNet4/Mvc/AdvancedSearch-Multilayered/FrontApp/Controllers/EqProxyController.cs @@ -1,175 +1,180 @@ -using System; -using System.Collections.Generic; +using System; using System.IO; -using System.Linq; using System.Net; using System.Net.Http; using System.Text; using System.Threading; using System.Threading.Tasks; -using System.Web; -using System.Web.Mvc; + +using Microsoft.AspNetCore.Mvc; +using Microsoft.Extensions.Configuration; namespace EqDemo.Controllers { - [RoutePrefix("eqproxy")] + [Route("eqproxy")] public class EqProxyController : Controller { - private readonly HttpClient _httpClient; + private readonly IHttpClientFactory _httpClientFactory; + private readonly string _serviceBaseUrl; + + public EqProxyController(IHttpClientFactory httpClientFactory, IConfiguration configuration) + { + _httpClientFactory = httpClientFactory; + _serviceBaseUrl = configuration["ServiceApp:BaseUrl"] ?? "https://localhost:44331/api/easyquery/"; + } - public EqProxyController() + private HttpClient CreateClient() { - _httpClient = new HttpClient(); - _httpClient.BaseAddress = new Uri("https://localhost:44331/api/easyquery/"); // service app path + var client = _httpClientFactory.CreateClient(); + client.BaseAddress = new Uri(_serviceBaseUrl); + return client; } [HttpGet] - [AllowAnonymous] [Route("lck")] - public async Task GetLicenseKeyAsync(CancellationToken ct) + public async Task GetLicenseKeyAsync(CancellationToken ct) { - var response = await _httpClient.GetAsync("lck", ct); - var key = await response.Content.ReadAsStringAsync(); + using var client = CreateClient(); + var response = await client.GetAsync("lck", ct); + var key = await response.Content.ReadAsStringAsync(ct); return Content(key.Substring(1, key.Length - 2)); } [HttpGet] [Route("models/{modelId}")] - public async Task GetModelAsync(string modelId, CancellationToken ct) + public async Task GetModelAsync(string modelId, CancellationToken ct) { - _httpClient.DefaultRequestHeaders.TryAddWithoutValidation("x-eqjs-version", "7.1.0"); - var response = await _httpClient.GetAsync($"models/{modelId}", ct); - var content = await response.Content.ReadAsStringAsync(); + using var client = CreateClient(); + client.DefaultRequestHeaders.TryAddWithoutValidation("x-eqjs-version", "7.1.0"); + var response = await client.GetAsync($"models/{modelId}", ct); + var content = await response.Content.ReadAsStringAsync(ct); return JsonContent(content, response.StatusCode); } [HttpGet] [Route("models/{modelId}/queries/{queryId}")] - public async Task GetQueryAsync(string modelId, string queryId, CancellationToken ct) + public async Task GetQueryAsync(string modelId, string queryId, CancellationToken ct) { - var response = await _httpClient.GetAsync($"models/{modelId}/queries/{queryId}", ct); - var content = await response.Content.ReadAsStringAsync(); + using var client = CreateClient(); + var response = await client.GetAsync($"models/{modelId}/queries/{queryId}", ct); + var content = await response.Content.ReadAsStringAsync(ct); return JsonContent(content, response.StatusCode); } [HttpGet] [Route("models/{modelId}/queries")] - public async Task GetQueryListAsync(string modelId, CancellationToken ct) + public async Task GetQueryListAsync(string modelId, CancellationToken ct) { - var response = await _httpClient.GetAsync($"models/{modelId}/queries", ct); - var content = await response.Content.ReadAsStringAsync(); + using var client = CreateClient(); + var response = await client.GetAsync($"models/{modelId}/queries", ct); + var content = await response.Content.ReadAsStringAsync(ct); return JsonContent(content, response.StatusCode); } [HttpPost] [Route("models/{modelId}/queries")] - public async Task NewQueryAsync(string modelId, CancellationToken ct) + public async Task NewQueryAsync(string modelId, CancellationToken ct) { - var stream = Request.InputStream; - stream.Seek(0, System.IO.SeekOrigin.Begin); - var bodyJson = await new StreamReader(stream).ReadToEndAsync(); + using var client = CreateClient(); + using var reader = new StreamReader(Request.Body); + var bodyJson = await reader.ReadToEndAsync(ct); var requestContent = new StringContent(bodyJson); - var response = await _httpClient.PostAsync($"models/{modelId}/queries", requestContent, ct); - var content = await response.Content.ReadAsStringAsync(); + var response = await client.PostAsync($"models/{modelId}/queries", requestContent, ct); + var content = await response.Content.ReadAsStringAsync(ct); return JsonContent(content, response.StatusCode); } [HttpPut] [Route("models/{modelId}/queries/{queryId}")] - public async Task SaveQueryAsync(string modelId, string queryId, CancellationToken ct) + public async Task SaveQueryAsync(string modelId, string queryId, CancellationToken ct) { - var stream = Request.InputStream; - stream.Seek(0, System.IO.SeekOrigin.Begin); - var bodyJson = await new StreamReader(stream).ReadToEndAsync(); + using var client = CreateClient(); + using var reader = new StreamReader(Request.Body); + var bodyJson = await reader.ReadToEndAsync(ct); var requestContent = new StringContent(bodyJson); - var response = await _httpClient.PutAsync($"models/{modelId}/queries/{queryId}", requestContent, ct); - var content = await response.Content.ReadAsStringAsync(); + var response = await client.PutAsync($"models/{modelId}/queries/{queryId}", requestContent, ct); + var content = await response.Content.ReadAsStringAsync(ct); return JsonContent(content, response.StatusCode); } [HttpDelete] [Route("models/{modelId}/queries/{queryId}")] - public async Task RemoveQueryAsync(string modelId, string queryId, CancellationToken ct) + public async Task RemoveQueryAsync(string modelId, string queryId, CancellationToken ct) { - var response = await _httpClient.DeleteAsync($"models/{modelId}/queries/{queryId}", ct); - var content = await response.Content.ReadAsStringAsync(); + using var client = CreateClient(); + var response = await client.DeleteAsync($"models/{modelId}/queries/{queryId}", ct); + var content = await response.Content.ReadAsStringAsync(ct); return JsonContent(content, response.StatusCode); } [HttpPost] [Route("models/{modelId}/queries/{queryId}/sync")] - public async Task SyncQueryAsync(string modelId, string queryId, CancellationToken ct) + public async Task SyncQueryAsync(string modelId, string queryId, CancellationToken ct) { - var stream = Request.InputStream; - stream.Seek(0, System.IO.SeekOrigin.Begin); - var bodyJson = await new StreamReader(stream).ReadToEndAsync(); + using var client = CreateClient(); + using var reader = new StreamReader(Request.Body); + var bodyJson = await reader.ReadToEndAsync(ct); var requestContent = new StringContent(bodyJson); - var response = await _httpClient.PostAsync($"models/{modelId}/queries/{queryId}/sync", requestContent, ct); - var content = await response.Content.ReadAsStringAsync(); + var response = await client.PostAsync($"models/{modelId}/queries/{queryId}/sync", requestContent, ct); + var content = await response.Content.ReadAsStringAsync(ct); return JsonContent(content, response.StatusCode); } [HttpPost] [Route("models/{modelId}/fetch")] - public async Task FetchDataAsync(string modelId, CancellationToken ct) + public async Task FetchDataAsync(string modelId, CancellationToken ct) { - var stream = Request.InputStream; - stream.Seek(0, System.IO.SeekOrigin.Begin); - var bodyJson = await new StreamReader(stream).ReadToEndAsync(); + using var client = CreateClient(); + using var reader = new StreamReader(Request.Body); + var bodyJson = await reader.ReadToEndAsync(ct); var requestContent = new StringContent(bodyJson); - var response = await _httpClient.PostAsync($"models/{modelId}/fetch", requestContent, ct); - var content = await response.Content.ReadAsStringAsync(); + var response = await client.PostAsync($"models/{modelId}/fetch", requestContent, ct); + var content = await response.Content.ReadAsStringAsync(ct); return JsonContent(content, response.StatusCode); } [HttpGet] [Route("models/{modelId}/valuelists/{editorId}")] - public async Task GetValueListAsync(string modelId, string editorId, CancellationToken ct) + public async Task GetValueListAsync(string modelId, string editorId, CancellationToken ct) { - var response = await _httpClient.GetAsync($"models/{modelId}/valuelists/{editorId}", ct); - var content = await response.Content.ReadAsStringAsync(); + using var client = CreateClient(); + var response = await client.GetAsync($"models/{modelId}/valuelists/{editorId}", ct); + var content = await response.Content.ReadAsStringAsync(ct); return JsonContent(content, response.StatusCode); } [HttpPost] [Route("models/{modelId}/export/{formatType}")] - public async Task ExportResultAsync(string modelId, string formatType, CancellationToken ct) + public async Task ExportResultAsync(string modelId, string formatType, CancellationToken ct) { - var stream = Request.InputStream; - stream.Seek(0, System.IO.SeekOrigin.Begin); - var bodyJson = await new StreamReader(stream).ReadToEndAsync(); + using var client = CreateClient(); + using var reader = new StreamReader(Request.Body); + var bodyJson = await reader.ReadToEndAsync(ct); var requestContent = new StringContent(bodyJson); - var response = await _httpClient.PostAsync($"models/{modelId}/export/{formatType}", requestContent, ct); + var response = await client.PostAsync($"models/{modelId}/export/{formatType}", requestContent, ct); if (response.IsSuccessStatusCode) { - var content = await response.Content.ReadAsByteArrayAsync(); + var content = await response.Content.ReadAsByteArrayAsync(ct); var contentType = response.Content.Headers.ContentType.MediaType; var fileName = response.Content.Headers.ContentDisposition.FileName; return File(content, contentType, fileName.Substring(1, fileName.Length - 2)); } else { - var content = await response.Content.ReadAsStringAsync(); + var content = await response.Content.ReadAsStringAsync(ct); return JsonContent(content, response.StatusCode); } } - - protected override void Dispose(bool disposing) - { - base.Dispose(disposing); - - _httpClient.Dispose(); - } - private static UTF8Encoding _utf8NoBomEncoding = new UTF8Encoding(false); - protected ContentResult JsonContent(string json, HttpStatusCode statusCode = HttpStatusCode.OK) + private static readonly UTF8Encoding Utf8NoBomEncoding = new UTF8Encoding(false); + private ContentResult JsonContent(string json, HttpStatusCode statusCode = HttpStatusCode.OK) { HttpContext.Response.StatusCode = (int)statusCode; - return Content(json, "application/json", _utf8NoBomEncoding); + return Content(json, "application/json", Utf8NoBomEncoding); } } -} \ No newline at end of file +} diff --git a/AspNet4/Mvc/AdvancedSearch-Multilayered/FrontApp/Controllers/HomeController.cs b/AspNet4/Mvc/AdvancedSearch-Multilayered/FrontApp/Controllers/HomeController.cs index e8448690..594b6dd0 100644 --- a/AspNet4/Mvc/AdvancedSearch-Multilayered/FrontApp/Controllers/HomeController.cs +++ b/AspNet4/Mvc/AdvancedSearch-Multilayered/FrontApp/Controllers/HomeController.cs @@ -1,16 +1,12 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web; -using System.Web.Mvc; +using Microsoft.AspNetCore.Mvc; -namespace EqDemo.AspNet4x.AdvancedSearch.Controllers +namespace EqDemo.Controllers { public class HomeController : Controller { - public ActionResult Index() + public IActionResult Index() { return View(); } } -} \ No newline at end of file +} diff --git a/AspNet4/Mvc/AdvancedSearch-Multilayered/FrontApp/EqDemo.AspNet4x.MultiLayered.FrontApp.csproj b/AspNet4/Mvc/AdvancedSearch-Multilayered/FrontApp/EqDemo.AspNet4x.MultiLayered.FrontApp.csproj index 128c4527..d3cd4a84 100644 --- a/AspNet4/Mvc/AdvancedSearch-Multilayered/FrontApp/EqDemo.AspNet4x.MultiLayered.FrontApp.csproj +++ b/AspNet4/Mvc/AdvancedSearch-Multilayered/FrontApp/EqDemo.AspNet4x.MultiLayered.FrontApp.csproj @@ -1,174 +1,9 @@ - - - - + - Debug - AnyCPU - - - 2.0 - {953CBD6B-5213-4930-B0E5-4AC110A0597A} - {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - Library - Properties + net8.0 EqDemo - EqDemo.AspNet4x.MultiLayered.FrontApp - v4.6.1 - false - true - - 44320 - - - - - - - - true - full - false - bin\ - DEBUG;TRACE - prompt - 4 - - - true - pdbonly - true - bin\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - - - - - - - - - - - 13.0.3 - - - 1.6.0 - - - 5.2.7 - - - 3.2.7 - - - 3.2.7 - - - 1.1.3 - - - 1.0.0 - - - 6.2.0 - - - 2.0.0 - - - 3.5.1 - - - - - - - - - Global.asax - - + - - - - - - - - - Web.config - - - Web.config - - - - - - - - - - - - - - - - 10.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - - - - - - - - - True - True - 2383 - / - https://localhost:44330/ - False - False - - - False - - - - - - - - - - - - \ No newline at end of file + diff --git a/AspNet4/Mvc/AdvancedSearch-Multilayered/FrontApp/Global.asax b/AspNet4/Mvc/AdvancedSearch-Multilayered/FrontApp/Global.asax deleted file mode 100644 index 6277c625..00000000 --- a/AspNet4/Mvc/AdvancedSearch-Multilayered/FrontApp/Global.asax +++ /dev/null @@ -1 +0,0 @@ -<%@ Application Codebehind="Global.asax.cs" Inherits="EqDemo.AspNet4x.AdvancedSearch.MvcApplication" Language="C#" %> diff --git a/AspNet4/Mvc/AdvancedSearch-Multilayered/FrontApp/Global.asax.cs b/AspNet4/Mvc/AdvancedSearch-Multilayered/FrontApp/Global.asax.cs deleted file mode 100644 index 64b4071a..00000000 --- a/AspNet4/Mvc/AdvancedSearch-Multilayered/FrontApp/Global.asax.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Data.Entity.Migrations; -using System.Linq; -using System.Web.Mvc; -using System.Web.Optimization; -using System.Web.Routing; - -namespace EqDemo.AspNet4x.AdvancedSearch -{ - public class MvcApplication : System.Web.HttpApplication - { - protected void Application_Start() - { - AreaRegistration.RegisterAllAreas(); - - FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); - RouteConfig.RegisterRoutes(RouteTable.Routes); - BundleConfig.RegisterBundles(BundleTable.Bundles); - } - } -} diff --git a/AspNet4/Mvc/AdvancedSearch-Multilayered/FrontApp/Program.cs b/AspNet4/Mvc/AdvancedSearch-Multilayered/FrontApp/Program.cs new file mode 100644 index 00000000..83414752 --- /dev/null +++ b/AspNet4/Mvc/AdvancedSearch-Multilayered/FrontApp/Program.cs @@ -0,0 +1,20 @@ +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Hosting; + +namespace EqDemo +{ + public class Program + { + public static void Main(string[] args) + { + CreateHostBuilder(args).Build().Run(); + } + + public static IHostBuilder CreateHostBuilder(string[] args) => + Host.CreateDefaultBuilder(args) + .ConfigureWebHostDefaults(webBuilder => + { + webBuilder.UseStartup(); + }); + } +} diff --git a/AspNet4/Mvc/AdvancedSearch-Multilayered/FrontApp/Properties/AssemblyInfo.cs b/AspNet4/Mvc/AdvancedSearch-Multilayered/FrontApp/Properties/AssemblyInfo.cs deleted file mode 100644 index aa631edf..00000000 --- a/AspNet4/Mvc/AdvancedSearch-Multilayered/FrontApp/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("EqDemo.AspNet4x.AdvancedSearch")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("EqDemo.AspNet4x.AdvancedSearch")] -[assembly: AssemblyCopyright("Copyright © 2021")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("3e7ea557-c95f-4b8b-942c-072b21fbc3ca")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/AspNet4/Mvc/AdvancedSearch-Multilayered/FrontApp/Startup.cs b/AspNet4/Mvc/AdvancedSearch-Multilayered/FrontApp/Startup.cs new file mode 100644 index 00000000..559b9ffb --- /dev/null +++ b/AspNet4/Mvc/AdvancedSearch-Multilayered/FrontApp/Startup.cs @@ -0,0 +1,45 @@ +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; + +namespace EqDemo +{ + public class Startup + { + public Startup(IConfiguration configuration) + { + Configuration = configuration; + } + + public IConfiguration Configuration { get; } + + public void ConfigureServices(IServiceCollection services) + { + services.AddHttpClient(); + services.AddControllersWithViews(); + } + + public void Configure(IApplicationBuilder app, IWebHostEnvironment env) + { + if (env.IsDevelopment()) { + app.UseDeveloperExceptionPage(); + } + else { + app.UseExceptionHandler("/Home/Error"); + app.UseHsts(); + } + + app.UseHttpsRedirection(); + app.UseStaticFiles(); + app.UseRouting(); + + app.UseEndpoints(endpoints => { + endpoints.MapControllerRoute( + name: "default", + pattern: "{controller=Home}/{action=Index}/{id?}"); + }); + } + } +} diff --git a/AspNet4/Mvc/AdvancedSearch-Multilayered/FrontApp/Views/Web.config b/AspNet4/Mvc/AdvancedSearch-Multilayered/FrontApp/Views/Web.config deleted file mode 100644 index ce5c70c7..00000000 --- a/AspNet4/Mvc/AdvancedSearch-Multilayered/FrontApp/Views/Web.config +++ /dev/null @@ -1,43 +0,0 @@ - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/AspNet4/Mvc/AdvancedSearch-Multilayered/FrontApp/Web.Debug.config b/AspNet4/Mvc/AdvancedSearch-Multilayered/FrontApp/Web.Debug.config deleted file mode 100644 index d7712aaf..00000000 --- a/AspNet4/Mvc/AdvancedSearch-Multilayered/FrontApp/Web.Debug.config +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - diff --git a/AspNet4/Mvc/AdvancedSearch-Multilayered/FrontApp/Web.Release.config b/AspNet4/Mvc/AdvancedSearch-Multilayered/FrontApp/Web.Release.config deleted file mode 100644 index 28a4d5fc..00000000 --- a/AspNet4/Mvc/AdvancedSearch-Multilayered/FrontApp/Web.Release.config +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - diff --git a/AspNet4/Mvc/AdvancedSearch-Multilayered/FrontApp/Web.config b/AspNet4/Mvc/AdvancedSearch-Multilayered/FrontApp/Web.config deleted file mode 100644 index 4de3b030..00000000 --- a/AspNet4/Mvc/AdvancedSearch-Multilayered/FrontApp/Web.config +++ /dev/null @@ -1,296 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/AspNet4/Mvc/AdvancedSearch-Multilayered/FrontApp/appsettings.json b/AspNet4/Mvc/AdvancedSearch-Multilayered/FrontApp/appsettings.json new file mode 100644 index 00000000..f8f3556e --- /dev/null +++ b/AspNet4/Mvc/AdvancedSearch-Multilayered/FrontApp/appsettings.json @@ -0,0 +1,11 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Warning" + } + }, + "AllowedHosts": "*", + "ServiceApp": { + "BaseUrl": "https://localhost:44331/api/easyquery/" + } +} diff --git a/AspNet4/Mvc/AdvancedSearch-Multilayered/ServiceApp/App_Start/BundleConfig.cs b/AspNet4/Mvc/AdvancedSearch-Multilayered/ServiceApp/App_Start/BundleConfig.cs deleted file mode 100644 index 084eb023..00000000 --- a/AspNet4/Mvc/AdvancedSearch-Multilayered/ServiceApp/App_Start/BundleConfig.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Web; -using System.Web.Optimization; - -namespace EqDemo.AspNet4x.AdvancedSearch -{ - public class BundleConfig - { - // For more information on bundling, visit https://go.microsoft.com/fwlink/?LinkId=301862 - public static void RegisterBundles(BundleCollection bundles) - { - } - } -} diff --git a/AspNet4/Mvc/AdvancedSearch-Multilayered/ServiceApp/App_Start/FilterConfig.cs b/AspNet4/Mvc/AdvancedSearch-Multilayered/ServiceApp/App_Start/FilterConfig.cs deleted file mode 100644 index 8897d3f4..00000000 --- a/AspNet4/Mvc/AdvancedSearch-Multilayered/ServiceApp/App_Start/FilterConfig.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Web; -using System.Web.Mvc; - -namespace EqDemo.AspNet4x.AdvancedSearch -{ - public class FilterConfig - { - public static void RegisterGlobalFilters(GlobalFilterCollection filters) - { - filters.Add(new HandleErrorAttribute()); - } - } -} diff --git a/AspNet4/Mvc/AdvancedSearch-Multilayered/ServiceApp/App_Start/RouteConfig.cs b/AspNet4/Mvc/AdvancedSearch-Multilayered/ServiceApp/App_Start/RouteConfig.cs deleted file mode 100644 index 66738f58..00000000 --- a/AspNet4/Mvc/AdvancedSearch-Multilayered/ServiceApp/App_Start/RouteConfig.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web; -using System.Web.Mvc; -using System.Web.Routing; - -namespace EqDemo.AspNet4x.AdvancedSearch -{ - public class RouteConfig - { - public static void RegisterRoutes(RouteCollection routes) - { - routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); - - routes.MapRoute( - name: "Default", - url: "{controller}/{action}/{id}", - defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional } - ); - } - } -} diff --git a/AspNet4/Mvc/AdvancedSearch-Multilayered/ServiceApp/App_Start/WebApiConfig.cs b/AspNet4/Mvc/AdvancedSearch-Multilayered/ServiceApp/App_Start/WebApiConfig.cs deleted file mode 100644 index 4eec3091..00000000 --- a/AspNet4/Mvc/AdvancedSearch-Multilayered/ServiceApp/App_Start/WebApiConfig.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web; -using System.Web.Http; -using System.Web.Http.Controllers; -using System.Web.Http.Routing; -using System.Web.Http.WebHost; -using System.Web.Routing; -using System.Web.SessionState; -using EasyData.Export; -using Korzh.EasyQuery.Services; - -namespace EqDemo -{ - public static class WebApiConfig - { - public static void Register(HttpConfiguration config) - { - // Web API configuration and services - - // Web API routes - config.MapHttpAttributeRoutes(new WebApiCustomDirectRouteProvider()); - - config.Routes.MapHttpRoute( - name: "DefaultApi", - routeTemplate: "api/{controller}/{id}", - defaults: new { id = RouteParameter.Optional } - ); - - // Register you exportes here - // to make export works - EasyQueryManager.RegisterExporter("csv", new CsvDataExporter()); - EasyQueryManager.RegisterExporter("excel", new ExcelDataExporter()); - EasyQueryManager.RegisterExporter("pdf", new PdfDataExporter()); - - EasyQueryManagerSql.RegisterDbGate(); - } - } - - - public class WebApiCustomDirectRouteProvider : DefaultDirectRouteProvider - { - protected override IReadOnlyList - GetActionRouteFactories(HttpActionDescriptor actionDescriptor) - { - // inherit route attributes decorated on base class controller's actions - return actionDescriptor.GetCustomAttributes(inherit: true); - } - } -} diff --git a/AspNet4/Mvc/AdvancedSearch-Multilayered/ServiceApp/Controllers/EasyQuery/AdvancedSearchController.cs b/AspNet4/Mvc/AdvancedSearch-Multilayered/ServiceApp/Controllers/EasyQuery/AdvancedSearchController.cs deleted file mode 100644 index 450b3e7a..00000000 --- a/AspNet4/Mvc/AdvancedSearch-Multilayered/ServiceApp/Controllers/EasyQuery/AdvancedSearchController.cs +++ /dev/null @@ -1,61 +0,0 @@ -using System; -using System.Configuration; -using System.Web.Http; -using System.Data.SqlClient; -using System.Threading; -using System.Threading.Tasks; - -using Korzh.EasyQuery.Services; -using Korzh.EasyQuery.AspNet; - -using EqDemo.Models; - -namespace EqDemo.Controllers -{ - [RoutePrefix("api/easyquery")] - public class AdvancedSearchController : EasyQueryApiController - { - protected override void ConfigureEasyQueryOptions(EasyQueryOptions options) - { - options.UseManager(); - options.DefaultModelId = "nwind"; - options.BuildQueryOnSync = true; - options.SaveQueryOnSync = false; - - options.UseDbContext(ApplicationDbContext.Create()); - - // If you want to load model directly from DB metadata - // remove (or comment) options.UseDbContext(...) call and uncomment the next 3 lines of code - //options.ConnectionString = - // ConfigurationManager.ConnectionStrings["DefaultConnection"]?.ToString(); - //options.UseDbConnection(); - //options.UseDbConnectionModelLoader(); - - var path = System.Web.Hosting.HostingEnvironment.MapPath("~/App_Data"); - options.UseQueryStore((_) => new FileQueryStore(path)); - } - - public override async Task SaveQueryAsync(string modelId, string queryId, CancellationToken ct) - { - try - { - var requestStream = await Request.Content.ReadAsStreamAsync(); - await Manager.ReadRequestContentFromStreamAsync(modelId, requestStream, ct); - await Manager.SaveQueryToStoreAsync(true, ct); - - if (Options.ReturnQueryOnSave) - { - var query = Manager.Query; - - return EqOk(new { query }); - } - - return EqOk(); - } - catch (Exception ex) - { - return EqError(ex); - } - } - } -} diff --git a/AspNet4/Mvc/AdvancedSearch-Multilayered/ServiceApp/Controllers/HomeController.cs b/AspNet4/Mvc/AdvancedSearch-Multilayered/ServiceApp/Controllers/HomeController.cs index e8448690..594b6dd0 100644 --- a/AspNet4/Mvc/AdvancedSearch-Multilayered/ServiceApp/Controllers/HomeController.cs +++ b/AspNet4/Mvc/AdvancedSearch-Multilayered/ServiceApp/Controllers/HomeController.cs @@ -1,16 +1,12 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web; -using System.Web.Mvc; +using Microsoft.AspNetCore.Mvc; -namespace EqDemo.AspNet4x.AdvancedSearch.Controllers +namespace EqDemo.Controllers { public class HomeController : Controller { - public ActionResult Index() + public IActionResult Index() { return View(); } } -} \ No newline at end of file +} diff --git a/AspNet4/Mvc/AdvancedSearch-Multilayered/ServiceApp/Data/ApplicationDbContext.cs b/AspNet4/Mvc/AdvancedSearch-Multilayered/ServiceApp/Data/ApplicationDbContext.cs index b1d890be..3a29f8c3 100644 --- a/AspNet4/Mvc/AdvancedSearch-Multilayered/ServiceApp/Data/ApplicationDbContext.cs +++ b/AspNet4/Mvc/AdvancedSearch-Multilayered/ServiceApp/Data/ApplicationDbContext.cs @@ -1,15 +1,15 @@ -using System.Data.Entity; +using Microsoft.EntityFrameworkCore; namespace EqDemo.Models { public class ApplicationDbContext : DbContext { - public ApplicationDbContext() - : base("DefaultConnection") - { + public ApplicationDbContext(DbContextOptions options) + : base(options) + { + } - #region NWind public DbSet Categories { get; set; } @@ -29,7 +29,7 @@ public ApplicationDbContext() #endregion - protected override void OnModelCreating(DbModelBuilder modelBuilder) + protected override void OnModelCreating(ModelBuilder modelBuilder) { base.OnModelCreating(modelBuilder); @@ -38,9 +38,6 @@ protected override void OnModelCreating(DbModelBuilder modelBuilder) .HasKey(od => new { od.OrderID, od.ProductID }); } - public static ApplicationDbContext Create() - { - return new ApplicationDbContext(); - } } -} \ No newline at end of file + +} diff --git a/AspNet4/Mvc/AdvancedSearch-Multilayered/ServiceApp/EqDemo.AspNet4x.MultiLayered.ServiceApp.csproj b/AspNet4/Mvc/AdvancedSearch-Multilayered/ServiceApp/EqDemo.AspNet4x.MultiLayered.ServiceApp.csproj index 942f0b97..31b5af36 100644 --- a/AspNet4/Mvc/AdvancedSearch-Multilayered/ServiceApp/EqDemo.AspNet4x.MultiLayered.ServiceApp.csproj +++ b/AspNet4/Mvc/AdvancedSearch-Multilayered/ServiceApp/EqDemo.AspNet4x.MultiLayered.ServiceApp.csproj @@ -1,222 +1,30 @@ - - - - + - Debug - AnyCPU - - - 2.0 - {32C7CC19-CBB8-469D-87EA-4E4E1FAAC4B4} - {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - Library - Properties + net8.0 EqDemo - EqDemo.AspNet4x.MultiLayered.ServiceApp - v4.6.1 - false - true - - 44320 - - - - - - - - - true - full - false - bin\ - DEBUG;TRACE - prompt - 4 - - - true - pdbonly - true - bin\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - - - - - - - - - 7.4.0-rc04 - - - 4.8.6 - - - 4.7.2 - - - 1.6.0 - - - 5.2.7 - - - 5.2.7 - - - 5.2.7 - - - 3.2.7 - - - 3.2.7 - - - 1.1.3 - - - 1.0.0 - - - 6.2.0 - - - 2.0.0 - - - 3.5.1 - + + - + - - - - - + + - - - - - - - - - Global.asax - - - - 202101141900542_IntitalCreate.cs - - - - - - - - - - - + + - - - - - - - - Web.config + + PreserveNewest - - Web.config - - - - - - - - - - 202101141900542_IntitalCreate.cs - - - - - - - - - - - - 10.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - - - - - - - - - True - True - 2383 - / - https://localhost:44331/ - False - False - - - False - - - - - - - - - - - - \ No newline at end of file + diff --git a/AspNet4/Mvc/AdvancedSearch-Multilayered/ServiceApp/Global.asax b/AspNet4/Mvc/AdvancedSearch-Multilayered/ServiceApp/Global.asax deleted file mode 100644 index 6277c625..00000000 --- a/AspNet4/Mvc/AdvancedSearch-Multilayered/ServiceApp/Global.asax +++ /dev/null @@ -1 +0,0 @@ -<%@ Application Codebehind="Global.asax.cs" Inherits="EqDemo.AspNet4x.AdvancedSearch.MvcApplication" Language="C#" %> diff --git a/AspNet4/Mvc/AdvancedSearch-Multilayered/ServiceApp/Global.asax.cs b/AspNet4/Mvc/AdvancedSearch-Multilayered/ServiceApp/Global.asax.cs deleted file mode 100644 index 60daf7b1..00000000 --- a/AspNet4/Mvc/AdvancedSearch-Multilayered/ServiceApp/Global.asax.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Data.Entity.Migrations; -using System.Linq; -using System.Web; -using System.Web.Http; -using System.Web.Mvc; -using System.Web.Optimization; -using System.Web.Routing; - -using EqDemo.Migrations; - -namespace EqDemo.AspNet4x.AdvancedSearch -{ - public class MvcApplication : System.Web.HttpApplication - { - protected void Application_Start() - { - AreaRegistration.RegisterAllAreas(); - GlobalConfiguration.Configure(WebApiConfig.Register); - FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); - RouteConfig.RegisterRoutes(RouteTable.Routes); - BundleConfig.RegisterBundles(BundleTable.Bundles); - - // init db - var databaseMigrator = new DbMigrator(new Configuration()); - databaseMigrator.Update(); - } - } -} diff --git a/AspNet4/Mvc/AdvancedSearch-Multilayered/ServiceApp/Migrations/202101141900542_IntitalCreate.Designer.cs b/AspNet4/Mvc/AdvancedSearch-Multilayered/ServiceApp/Migrations/202101141900542_IntitalCreate.Designer.cs deleted file mode 100644 index 937c5cbf..00000000 --- a/AspNet4/Mvc/AdvancedSearch-Multilayered/ServiceApp/Migrations/202101141900542_IntitalCreate.Designer.cs +++ /dev/null @@ -1,29 +0,0 @@ -// -namespace EqDemo.Migrations -{ - using System.CodeDom.Compiler; - using System.Data.Entity.Migrations; - using System.Data.Entity.Migrations.Infrastructure; - using System.Resources; - - [GeneratedCode("EntityFramework.Migrations", "6.2.0-61023")] - public sealed partial class IntitalCreate : IMigrationMetadata - { - private readonly ResourceManager Resources = new ResourceManager(typeof(IntitalCreate)); - - string IMigrationMetadata.Id - { - get { return "202101141900542_IntitalCreate"; } - } - - string IMigrationMetadata.Source - { - get { return null; } - } - - string IMigrationMetadata.Target - { - get { return Resources.GetString("Target"); } - } - } -} diff --git a/AspNet4/Mvc/AdvancedSearch-Multilayered/ServiceApp/Migrations/202101141900542_IntitalCreate.cs b/AspNet4/Mvc/AdvancedSearch-Multilayered/ServiceApp/Migrations/202101141900542_IntitalCreate.cs deleted file mode 100644 index 54dedd7d..00000000 --- a/AspNet4/Mvc/AdvancedSearch-Multilayered/ServiceApp/Migrations/202101141900542_IntitalCreate.cs +++ /dev/null @@ -1,185 +0,0 @@ -namespace EqDemo.Migrations -{ - using System; - using System.Data.Entity.Migrations; - - public partial class IntitalCreate : DbMigration - { - public override void Up() - { - CreateTable( - "dbo.Categories", - c => new - { - CategoryID = c.Int(nullable: false), - CategoryName = c.String(), - Description = c.String(), - Picture = c.Binary(), - }) - .PrimaryKey(t => t.CategoryID); - - CreateTable( - "dbo.Customers", - c => new - { - CustomerID = c.String(nullable: false, maxLength: 128), - CompanyName = c.String(), - Address = c.String(), - City = c.String(), - Region = c.String(), - PostalCode = c.String(), - Country = c.String(), - ContactName = c.String(), - ContactTitle = c.String(), - Phone = c.String(), - Fax = c.String(), - }) - .PrimaryKey(t => t.CustomerID); - - CreateTable( - "dbo.Employees", - c => new - { - EmployeeID = c.Int(nullable: false), - LastName = c.String(nullable: false), - FirstName = c.String(nullable: false), - Title = c.String(maxLength: 30), - TitleOfCourtesy = c.String(), - BirthDate = c.DateTime(), - HireDate = c.DateTime(), - Address = c.String(), - City = c.String(), - Region = c.String(), - PostalCode = c.String(), - Country = c.String(), - HomePhone = c.String(maxLength: 24), - Extension = c.String(maxLength: 4), - Photo = c.Binary(), - PhotoPath = c.String(), - Notes = c.String(), - ReportsTo = c.Int(), - }) - .PrimaryKey(t => t.EmployeeID) - .ForeignKey("dbo.Employees", t => t.ReportsTo) - .Index(t => t.ReportsTo); - - CreateTable( - "dbo.Orders", - c => new - { - OrderID = c.Int(nullable: false), - OrderDate = c.DateTime(), - RequiredDate = c.DateTime(), - ShippedDate = c.DateTime(), - Freight = c.Decimal(precision: 18, scale: 2), - CustomerID = c.String(maxLength: 128), - EmployeeID = c.Int(), - ShipVia = c.Int(), - ShipName = c.String(), - ShipAddress = c.String(), - ShipCity = c.String(), - ShipRegion = c.String(), - ShipPostalCode = c.String(), - ShipCountry = c.String(), - }) - .PrimaryKey(t => t.OrderID) - .ForeignKey("dbo.Customers", t => t.CustomerID) - .ForeignKey("dbo.Employees", t => t.EmployeeID) - .Index(t => t.CustomerID) - .Index(t => t.EmployeeID); - - CreateTable( - "dbo.Order_Details", - c => new - { - OrderID = c.Int(nullable: false), - ProductID = c.Int(nullable: false), - UnitPrice = c.Decimal(nullable: false, precision: 18, scale: 2), - Quantity = c.Short(nullable: false), - Discount = c.Single(nullable: false), - }) - .PrimaryKey(t => new { t.OrderID, t.ProductID }) - .ForeignKey("dbo.Orders", t => t.OrderID, cascadeDelete: true) - .ForeignKey("dbo.Products", t => t.ProductID, cascadeDelete: true) - .Index(t => t.OrderID) - .Index(t => t.ProductID); - - CreateTable( - "dbo.Products", - c => new - { - ProductID = c.Int(nullable: false), - ProductName = c.String(), - SupplierID = c.Int(), - CategoryID = c.Int(), - QuantityPerUnit = c.String(), - UnitPrice = c.Decimal(precision: 18, scale: 2), - UnitsInStock = c.Short(), - UnitsOnOrder = c.Short(), - ReorderLevel = c.Short(), - Discontinued = c.Boolean(nullable: false), - }) - .PrimaryKey(t => t.ProductID) - .ForeignKey("dbo.Categories", t => t.CategoryID) - .ForeignKey("dbo.Suppliers", t => t.SupplierID) - .Index(t => t.SupplierID) - .Index(t => t.CategoryID); - - CreateTable( - "dbo.Suppliers", - c => new - { - SupplierID = c.Int(nullable: false, identity: true), - CompanyName = c.String(), - ContactName = c.String(), - ContactTitle = c.String(), - Address = c.String(), - City = c.String(), - Region = c.String(), - PostalCode = c.String(), - Country = c.String(), - Phone = c.String(), - Fax = c.String(), - HomePage = c.String(), - }) - .PrimaryKey(t => t.SupplierID); - - CreateTable( - "dbo.Shippers", - c => new - { - ShipperID = c.Int(nullable: false, identity: true), - CompanyName = c.String(), - Phone = c.String(), - }) - .PrimaryKey(t => t.ShipperID); - - } - - public override void Down() - { - DropForeignKey("dbo.Order_Details", "ProductID", "dbo.Products"); - DropForeignKey("dbo.Products", "SupplierID", "dbo.Suppliers"); - DropForeignKey("dbo.Products", "CategoryID", "dbo.Categories"); - DropForeignKey("dbo.Order_Details", "OrderID", "dbo.Orders"); - DropForeignKey("dbo.Orders", "EmployeeID", "dbo.Employees"); - DropForeignKey("dbo.Orders", "CustomerID", "dbo.Customers"); - DropForeignKey("dbo.Employees", "ReportsTo", "dbo.Employees"); - DropIndex("dbo.Products", new[] { "CategoryID" }); - DropIndex("dbo.Products", new[] { "SupplierID" }); - DropIndex("dbo.Order_Details", new[] { "ProductID" }); - DropIndex("dbo.Order_Details", new[] { "OrderID" }); - DropIndex("dbo.Orders", new[] { "EmployeeID" }); - DropIndex("dbo.Orders", new[] { "CustomerID" }); - DropIndex("dbo.Employees", new[] { "ReportsTo" }); - DropTable("dbo.Shippers"); - DropTable("dbo.Suppliers"); - DropTable("dbo.Products"); - DropTable("dbo.Order_Details"); - DropTable("dbo.Orders"); - DropTable("dbo.Employees"); - DropTable("dbo.Customers"); - DropTable("dbo.Categories"); - } - } -} diff --git a/AspNet4/Mvc/AdvancedSearch-Multilayered/ServiceApp/Migrations/202101141900542_IntitalCreate.resx b/AspNet4/Mvc/AdvancedSearch-Multilayered/ServiceApp/Migrations/202101141900542_IntitalCreate.resx deleted file mode 100644 index f0c0df5c..00000000 --- a/AspNet4/Mvc/AdvancedSearch-Multilayered/ServiceApp/Migrations/202101141900542_IntitalCreate.resx +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - H4sIAAAAAAAEAO1d3W7juBW+L9B3EHzVFrNxklkU28DZRSaZdINOfhpnBr0LGIlxhJUlj0QHCYp9sl70kfoKJfXDf0okJdmeQZCbmBS/Q5GH5xwdUp/+95//zn55WSbBM8yLOEuPJwd7+5MApmEWxenieLJGjz/8NPnl5z/+YfYxWr4EX5rr3pPrcMu0OJ48IbQ6mk6L8AkuQbG3jMM8K7JHtBdmyymIsunh/v7fpgcHU4ghJhgrCGa36xTFS1j+wD9PszSEK7QGyWUWwaSoy3HNvEQNrsASFisQwuPJx69ncJntVRdOgpMkBrgTc5g8TgKQphkCCHfx6HMB5yjP0sV8hQtAcve6gvi6R5AUsO76Ebvc9i72D8ldTFnDBipcFyhbOgIevK+HZSo39xrcCR02PHAf8QCjV3LX5eAdT04Bgossf50EsrCj0yQnF0pju9e0eBfU5SfF6gqiH1/2TqJngGcsmkOQh0/vqF5g9SF/74LTdYLWOTxO4RrlIHkX3Kwfkjj8B3y9y36D6XG6ThK+u7jDuE4owEU3ebaCOXq9hY/1TVxEk2AqtpvKDWkzrk11excpen84Ca6wcPCQQKoN3FDMUZbDv8MU5vjmoxuAEMzxZF5lKVQkS3Ka4SK/GolYBfFCmgSX4OUTTBfo6XiC/50E5/ELjJqSuhef0xivO9wI5etOYWewCPN4VenKyLJu4pBMZiPnQ5wCokY2cnjg2ZTpZLumlvoJcwdNrVt8N5qqmcuDw5+s5lLR7g6tzZYrkG5GaU+iKIdFMbqcU6xPowu5hYuNLL6sQCA5xdePP2wZ9sr5+COHvT0CIdqIytWy7mKUjC/s5ql0EyNLOScog8qwtswfl6ske4XQ3jI3Lb4byzxuDPEJFEOtC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yh2Oli8//x+XuC2CcqAAAA== - - - dbo - - \ No newline at end of file diff --git a/AspNet4/Mvc/AdvancedSearch-Multilayered/ServiceApp/Migrations/Configuration.cs b/AspNet4/Mvc/AdvancedSearch-Multilayered/ServiceApp/Migrations/Configuration.cs deleted file mode 100644 index 1536764f..00000000 --- a/AspNet4/Mvc/AdvancedSearch-Multilayered/ServiceApp/Migrations/Configuration.cs +++ /dev/null @@ -1,31 +0,0 @@ -namespace EqDemo.Migrations -{ - using Korzh.DbUtils; - using System; - using System.Data.Entity; - using System.Data.Entity.Migrations; - using System.Linq; - - internal sealed class Configuration : DbMigrationsConfiguration - { - public Configuration() - { - AutomaticMigrationsEnabled = false; - ContextKey = "EqDemo.Models.ApplicationDbContext"; - } - - protected override void Seed(EqDemo.Models.ApplicationDbContext context) - { - // This method will be called after migrating to the latest version. - - // You can use the DbSet.AddOrUpdate() helper extension method - // to avoid creating duplicate seed data. - - Korzh.DbUtils.DbInitializer.Create(options => { - options.UseSqlServer(context.Database.Connection.ConnectionString); - options.UseZipPacker(System.Web.Hosting.HostingEnvironment.MapPath("~/App_Data/EqDemoData.zip")); - }) - .Seed(); - } - } -} diff --git a/AspNet4/Mvc/AdvancedSearch-Multilayered/ServiceApp/Models/IdentityModels.cs b/AspNet4/Mvc/AdvancedSearch-Multilayered/ServiceApp/Models/IdentityModels.cs deleted file mode 100644 index 21299219..00000000 --- a/AspNet4/Mvc/AdvancedSearch-Multilayered/ServiceApp/Models/IdentityModels.cs +++ /dev/null @@ -1,76 +0,0 @@ -using System.Data.Entity; -using System.Security.Claims; -using System.Threading.Tasks; -using Microsoft.AspNet.Identity; -using Microsoft.AspNet.Identity.EntityFramework; - -namespace EqAspNet4Demo.Models -{ - // You can add profile data for the user by adding more properties to your ApplicationUser class, please visit https://go.microsoft.com/fwlink/?LinkID=317594 to learn more. - public class ApplicationUser : IdentityUser - { - public async Task GenerateUserIdentityAsync(UserManager manager) - { - // Note the authenticationType must match the one defined in CookieAuthenticationOptions.AuthenticationType - var userIdentity = await manager.CreateIdentityAsync(this, DefaultAuthenticationTypes.ApplicationCookie); - // Add custom user claims here - return userIdentity; - } - } - - public class ApplicationDbContext : IdentityDbContext - { - public ApplicationDbContext() - : base("DefaultConnection", throwIfV1Schema: false) - { - Database.SetInitializer(new NwindInitializer()); - } - - - - #region NWind - public DbSet Categories { get; set; } - - public DbSet Customers { get; set; } - - public DbSet Employees { get; set; } - - public DbSet Orders { get; set; } - - public DbSet Products { get; set; } - - public DbSet OrderDetails { get; set; } - - public DbSet Shippers { get; set; } - - public DbSet Suppliers { get; set; } - - #endregion - - protected override void OnModelCreating(DbModelBuilder modelBuilder) - { - base.OnModelCreating(modelBuilder); - - modelBuilder.Entity() - .ToTable("Order_Details") - .HasKey(od => new { od.OrderID, od.ProductID }); - } - - public static ApplicationDbContext Create() - { - return new ApplicationDbContext(); - } - - } - - public class NwindInitializer : CreateDatabaseIfNotExists - { - protected override void Seed(ApplicationDbContext context) - { - base.Seed(context); - - var initializer = new DbIntializer(context.Database.Connection.ConnectionString); - initializer.AddTestData(); - } - } -} \ No newline at end of file diff --git a/AspNet4/Mvc/AdvancedSearch-Multilayered/ServiceApp/Program.cs b/AspNet4/Mvc/AdvancedSearch-Multilayered/ServiceApp/Program.cs new file mode 100644 index 00000000..83414752 --- /dev/null +++ b/AspNet4/Mvc/AdvancedSearch-Multilayered/ServiceApp/Program.cs @@ -0,0 +1,20 @@ +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Hosting; + +namespace EqDemo +{ + public class Program + { + public static void Main(string[] args) + { + CreateHostBuilder(args).Build().Run(); + } + + public static IHostBuilder CreateHostBuilder(string[] args) => + Host.CreateDefaultBuilder(args) + .ConfigureWebHostDefaults(webBuilder => + { + webBuilder.UseStartup(); + }); + } +} diff --git a/AspNet4/Mvc/AdvancedSearch-Multilayered/ServiceApp/Properties/AssemblyInfo.cs b/AspNet4/Mvc/AdvancedSearch-Multilayered/ServiceApp/Properties/AssemblyInfo.cs deleted file mode 100644 index aa631edf..00000000 --- a/AspNet4/Mvc/AdvancedSearch-Multilayered/ServiceApp/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("EqDemo.AspNet4x.AdvancedSearch")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("EqDemo.AspNet4x.AdvancedSearch")] -[assembly: AssemblyCopyright("Copyright © 2021")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("3e7ea557-c95f-4b8b-942c-072b21fbc3ca")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/AspNet4/Mvc/AdvancedSearch-Multilayered/ServiceApp/Startup.cs b/AspNet4/Mvc/AdvancedSearch-Multilayered/ServiceApp/Startup.cs new file mode 100644 index 00000000..e9ad8866 --- /dev/null +++ b/AspNet4/Mvc/AdvancedSearch-Multilayered/ServiceApp/Startup.cs @@ -0,0 +1,74 @@ +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; + +using Korzh.EasyQuery.Services; +using Korzh.EasyQuery.Db; + +using EqDemo.Models; + +namespace EqDemo +{ + public class Startup + { + public Startup(IConfiguration configuration) + { + Configuration = configuration; + DbConnectionString = Configuration.GetConnectionString("DefaultConnection"); + } + + public IConfiguration Configuration { get; } + public string DbConnectionString { get; } + + public void ConfigureServices(IServiceCollection services) + { + services.AddDbContext( + options => options.UseSqlServer(DbConnectionString) + ); + + services.AddDistributedMemoryCache(); + services.AddSession(); + + services.AddEasyQuery() + .UseSqlManager() + .AddDefaultExporters() + .RegisterDbGate(); + + services.AddControllersWithViews(); + } + + public void Configure(IApplicationBuilder app, IWebHostEnvironment env) + { + if (env.IsDevelopment()) { + app.UseDeveloperExceptionPage(); + } + else { + app.UseExceptionHandler("/Home/Error"); + app.UseHsts(); + } + + app.UseHttpsRedirection(); + app.UseStaticFiles(); + app.UseRouting(); + app.UseSession(); + + app.UseEndpoints(endpoints => { + endpoints.MapEasyQuery(options => { + options.DefaultModelId = "nwind"; + options.BuildQueryOnSync = true; + options.SaveNewQuery = false; + options.ConnectionString = DbConnectionString; + options.UseDbContext(); + options.UseQueryStore((_) => new FileQueryStore("App_Data")); + }); + + endpoints.MapControllerRoute( + name: "default", + pattern: "{controller=Home}/{action=Index}/{id?}"); + }); + } + } +} diff --git a/AspNet4/Mvc/AdvancedSearch-Multilayered/ServiceApp/Views/Web.config b/AspNet4/Mvc/AdvancedSearch-Multilayered/ServiceApp/Views/Web.config deleted file mode 100644 index ce5c70c7..00000000 --- a/AspNet4/Mvc/AdvancedSearch-Multilayered/ServiceApp/Views/Web.config +++ /dev/null @@ -1,43 +0,0 @@ - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/AspNet4/Mvc/AdvancedSearch-Multilayered/ServiceApp/Web.Debug.config b/AspNet4/Mvc/AdvancedSearch-Multilayered/ServiceApp/Web.Debug.config deleted file mode 100644 index d7712aaf..00000000 --- a/AspNet4/Mvc/AdvancedSearch-Multilayered/ServiceApp/Web.Debug.config +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - diff --git a/AspNet4/Mvc/AdvancedSearch-Multilayered/ServiceApp/Web.Release.config b/AspNet4/Mvc/AdvancedSearch-Multilayered/ServiceApp/Web.Release.config deleted file mode 100644 index 28a4d5fc..00000000 --- a/AspNet4/Mvc/AdvancedSearch-Multilayered/ServiceApp/Web.Release.config +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - diff --git a/AspNet4/Mvc/AdvancedSearch-Multilayered/ServiceApp/Web.config b/AspNet4/Mvc/AdvancedSearch-Multilayered/ServiceApp/Web.config deleted file mode 100644 index 7ec26621..00000000 --- a/AspNet4/Mvc/AdvancedSearch-Multilayered/ServiceApp/Web.config +++ /dev/null @@ -1,320 +0,0 @@ - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/AspNet4/Mvc/AdvancedSearch-Multilayered/ServiceApp/appsettings.json b/AspNet4/Mvc/AdvancedSearch-Multilayered/ServiceApp/appsettings.json new file mode 100644 index 00000000..e12cd585 --- /dev/null +++ b/AspNet4/Mvc/AdvancedSearch-Multilayered/ServiceApp/appsettings.json @@ -0,0 +1,14 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Warning" + } + }, + "AllowedHosts": "*", + "ConnectionStrings": { + "DefaultConnection": "Data Source=(localdb)\\MSSQLLocalDB;Initial Catalog=EqDemo.AspNet4x.AdvancedSearch;Integrated Security=True;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False" + }, + "EasyQuery": { + "LicenseKey": "" + } +} diff --git a/AspNet4/Mvc/AdvancedSearch/App_Start/BundleConfig.cs b/AspNet4/Mvc/AdvancedSearch/App_Start/BundleConfig.cs deleted file mode 100644 index 084eb023..00000000 --- a/AspNet4/Mvc/AdvancedSearch/App_Start/BundleConfig.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Web; -using System.Web.Optimization; - -namespace EqDemo.AspNet4x.AdvancedSearch -{ - public class BundleConfig - { - // For more information on bundling, visit https://go.microsoft.com/fwlink/?LinkId=301862 - public static void RegisterBundles(BundleCollection bundles) - { - } - } -} diff --git a/AspNet4/Mvc/AdvancedSearch/App_Start/FilterConfig.cs b/AspNet4/Mvc/AdvancedSearch/App_Start/FilterConfig.cs deleted file mode 100644 index 8897d3f4..00000000 --- a/AspNet4/Mvc/AdvancedSearch/App_Start/FilterConfig.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Web; -using System.Web.Mvc; - -namespace EqDemo.AspNet4x.AdvancedSearch -{ - public class FilterConfig - { - public static void RegisterGlobalFilters(GlobalFilterCollection filters) - { - filters.Add(new HandleErrorAttribute()); - } - } -} diff --git a/AspNet4/Mvc/AdvancedSearch/App_Start/RouteConfig.cs b/AspNet4/Mvc/AdvancedSearch/App_Start/RouteConfig.cs deleted file mode 100644 index 66738f58..00000000 --- a/AspNet4/Mvc/AdvancedSearch/App_Start/RouteConfig.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web; -using System.Web.Mvc; -using System.Web.Routing; - -namespace EqDemo.AspNet4x.AdvancedSearch -{ - public class RouteConfig - { - public static void RegisterRoutes(RouteCollection routes) - { - routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); - - routes.MapRoute( - name: "Default", - url: "{controller}/{action}/{id}", - defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional } - ); - } - } -} diff --git a/AspNet4/Mvc/AdvancedSearch/App_Start/WebApiConfig.cs b/AspNet4/Mvc/AdvancedSearch/App_Start/WebApiConfig.cs deleted file mode 100644 index 93d56645..00000000 --- a/AspNet4/Mvc/AdvancedSearch/App_Start/WebApiConfig.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web; -using System.Web.Http; -using System.Web.Http.Controllers; -using System.Web.Http.Routing; -using System.Web.Http.WebHost; -using System.Web.Routing; -using System.Web.SessionState; -using EasyData.Export; -using Korzh.EasyQuery.AspNet; -using Korzh.EasyQuery.Services; - -namespace EqDemo -{ - public static class WebApiConfig - { - public static void Register(HttpConfiguration config) - { - // Web API configuration and services - - // Web API routes - config.MapHttpAttributeRoutesWithEasyQuery(); - - config.Routes.MapHttpRoute( - name: "DefaultApi", - routeTemplate: "api/{controller}/{id}", - defaults: new { id = RouteParameter.Optional } - ); - - // Register you exporters here - EasyQueryManager.RegisterExporter("csv", new CsvDataExporter()); - EasyQueryManager.RegisterExporter("excel", new ExcelDataExporter()); - EasyQueryManager.RegisterExporter("pdf", new PdfDataExporter()); - - //Register your DB gates here (to use DB model loaders) - EasyQueryManagerSql.RegisterDbGate(); - } - } -} diff --git a/AspNet4/Mvc/AdvancedSearch/Controllers/EasyQuery/AdvancedSearchController.cs b/AspNet4/Mvc/AdvancedSearch/Controllers/EasyQuery/AdvancedSearchController.cs deleted file mode 100644 index 154fbbcc..00000000 --- a/AspNet4/Mvc/AdvancedSearch/Controllers/EasyQuery/AdvancedSearchController.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System; -using System.Configuration; -using System.Web.Http; -using System.Data.SqlClient; -using System.Threading; -using System.Threading.Tasks; - -using Korzh.EasyQuery.Services; -using Korzh.EasyQuery.AspNet; - -using EqDemo.Models; - -namespace EqDemo.Controllers -{ - [RoutePrefix("api/easyquery")] - public class AdvancedSearchController : EasyQueryApiController - { - protected override void ConfigureEasyQueryOptions(EasyQueryOptions options) - { - options.UseManager(); - options.DefaultModelId = "nwind"; - options.BuildQueryOnSync = true; - options.SaveQueryOnSync = false; - - options.UseDbContext(ApplicationDbContext.Create(), extractorOptions => { - extractorOptions.HidePrimaryKeys = false; - }); - - // If you want to load model directly from DB metadata - // remove (or comment) options.UseDbContext(...) call and uncomment the next 3 lines of code - //options.ConnectionString = ConfigurationManager.ConnectionStrings["DefaultConnection"]?.ToString(); - //options.UseDbConnection(); - //options.UseDbConnectionModelLoader(); - - var path = System.Web.Hosting.HostingEnvironment.MapPath("~/App_Data"); - options.UseQueryStore((_) => new FileQueryStore(path)); - } - } -} diff --git a/AspNet4/Mvc/AdvancedSearch/Controllers/HomeController.cs b/AspNet4/Mvc/AdvancedSearch/Controllers/HomeController.cs index e8448690..594b6dd0 100644 --- a/AspNet4/Mvc/AdvancedSearch/Controllers/HomeController.cs +++ b/AspNet4/Mvc/AdvancedSearch/Controllers/HomeController.cs @@ -1,16 +1,12 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web; -using System.Web.Mvc; +using Microsoft.AspNetCore.Mvc; -namespace EqDemo.AspNet4x.AdvancedSearch.Controllers +namespace EqDemo.Controllers { public class HomeController : Controller { - public ActionResult Index() + public IActionResult Index() { return View(); } } -} \ No newline at end of file +} diff --git a/AspNet4/Mvc/AdvancedSearch/Data/ApplicationDbContext.cs b/AspNet4/Mvc/AdvancedSearch/Data/ApplicationDbContext.cs index 24032a36..3a29f8c3 100644 --- a/AspNet4/Mvc/AdvancedSearch/Data/ApplicationDbContext.cs +++ b/AspNet4/Mvc/AdvancedSearch/Data/ApplicationDbContext.cs @@ -1,11 +1,11 @@ -using System.Data.Entity; +using Microsoft.EntityFrameworkCore; namespace EqDemo.Models { public class ApplicationDbContext : DbContext { - public ApplicationDbContext() - : base("DefaultConnection") + public ApplicationDbContext(DbContextOptions options) + : base(options) { } @@ -29,7 +29,7 @@ public ApplicationDbContext() #endregion - protected override void OnModelCreating(DbModelBuilder modelBuilder) + protected override void OnModelCreating(ModelBuilder modelBuilder) { base.OnModelCreating(modelBuilder); @@ -38,11 +38,6 @@ protected override void OnModelCreating(DbModelBuilder modelBuilder) .HasKey(od => new { od.OrderID, od.ProductID }); } - public static ApplicationDbContext Create() - { - return new ApplicationDbContext(); - } - } -} \ No newline at end of file +} diff --git a/AspNet4/Mvc/AdvancedSearch/EqDemo.AspNet4x.AdvancedSearch.csproj b/AspNet4/Mvc/AdvancedSearch/EqDemo.AspNet4x.AdvancedSearch.csproj index a5f59107..eac3c745 100644 --- a/AspNet4/Mvc/AdvancedSearch/EqDemo.AspNet4x.AdvancedSearch.csproj +++ b/AspNet4/Mvc/AdvancedSearch/EqDemo.AspNet4x.AdvancedSearch.csproj @@ -1,224 +1,31 @@ - - - - - - Debug - AnyCPU - - - 2.0 - {F063D29F-C3C2-4076-A036-F891AC8C09AE} - {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - Library - Properties - EqDemo - EqDemo.AspNet4x.AdvancedSearch - v4.8 - false - true - - 44320 - - - - - - - - true - - - true - full - false - bin\ - DEBUG;TRACE - prompt - 4 - - - true - pdbonly - true - bin\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - - - - - - - - - - 13.0.3 - - - 4.8.6 - - - 6.0.0 - - - 1.6.0 - - - 5.2.7 - - - 5.2.7 - - - 5.2.7 - - - 3.2.7 - - - 3.2.7 - - - 1.1.3 - - - 1.0.0 - - - 6.4.4 - - - 2.0.0 - - - 3.5.1 - - - - - - - - - - - - - - - - - - - - - - - - - - - Global.asax - - - - 202101141900542_IntitalCreate.cs - - - - - - - - - - - - - - - - - - - - - Web.config - - - Web.config - - - - - - - - - - 202101141900542_IntitalCreate.cs - - - - - - - - - - - - - 10.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - - - - - - - - - True - True - 2383 - / - https://localhost:44320/ - False - False - - - False - - - - - - - - - - - - \ No newline at end of file + + + net8.0 + EqDemo + True + + + + + + + + + + + + + + + + + + + + + + + PreserveNewest + + + diff --git a/AspNet4/Mvc/AdvancedSearch/Global.asax b/AspNet4/Mvc/AdvancedSearch/Global.asax deleted file mode 100644 index 6277c625..00000000 --- a/AspNet4/Mvc/AdvancedSearch/Global.asax +++ /dev/null @@ -1 +0,0 @@ -<%@ Application Codebehind="Global.asax.cs" Inherits="EqDemo.AspNet4x.AdvancedSearch.MvcApplication" Language="C#" %> diff --git a/AspNet4/Mvc/AdvancedSearch/Global.asax.cs b/AspNet4/Mvc/AdvancedSearch/Global.asax.cs deleted file mode 100644 index 60daf7b1..00000000 --- a/AspNet4/Mvc/AdvancedSearch/Global.asax.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Data.Entity.Migrations; -using System.Linq; -using System.Web; -using System.Web.Http; -using System.Web.Mvc; -using System.Web.Optimization; -using System.Web.Routing; - -using EqDemo.Migrations; - -namespace EqDemo.AspNet4x.AdvancedSearch -{ - public class MvcApplication : System.Web.HttpApplication - { - protected void Application_Start() - { - AreaRegistration.RegisterAllAreas(); - GlobalConfiguration.Configure(WebApiConfig.Register); - FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); - RouteConfig.RegisterRoutes(RouteTable.Routes); - BundleConfig.RegisterBundles(BundleTable.Bundles); - - // init db - var databaseMigrator = new DbMigrator(new Configuration()); - databaseMigrator.Update(); - } - } -} diff --git a/AspNet4/Mvc/AdvancedSearch/Migrations/202101141900542_IntitalCreate.Designer.cs b/AspNet4/Mvc/AdvancedSearch/Migrations/202101141900542_IntitalCreate.Designer.cs deleted file mode 100644 index 937c5cbf..00000000 --- a/AspNet4/Mvc/AdvancedSearch/Migrations/202101141900542_IntitalCreate.Designer.cs +++ /dev/null @@ -1,29 +0,0 @@ -// -namespace EqDemo.Migrations -{ - using System.CodeDom.Compiler; - using System.Data.Entity.Migrations; - using System.Data.Entity.Migrations.Infrastructure; - using System.Resources; - - [GeneratedCode("EntityFramework.Migrations", "6.2.0-61023")] - public sealed partial class IntitalCreate : IMigrationMetadata - { - private readonly ResourceManager Resources = new ResourceManager(typeof(IntitalCreate)); - - string IMigrationMetadata.Id - { - get { return "202101141900542_IntitalCreate"; } - } - - string IMigrationMetadata.Source - { - get { return null; } - } - - string IMigrationMetadata.Target - { - get { return Resources.GetString("Target"); } - } - } -} diff --git a/AspNet4/Mvc/AdvancedSearch/Migrations/202101141900542_IntitalCreate.cs b/AspNet4/Mvc/AdvancedSearch/Migrations/202101141900542_IntitalCreate.cs deleted file mode 100644 index 54dedd7d..00000000 --- a/AspNet4/Mvc/AdvancedSearch/Migrations/202101141900542_IntitalCreate.cs +++ /dev/null @@ -1,185 +0,0 @@ -namespace EqDemo.Migrations -{ - using System; - using System.Data.Entity.Migrations; - - public partial class IntitalCreate : DbMigration - { - public override void Up() - { - CreateTable( - "dbo.Categories", - c => new - { - CategoryID = c.Int(nullable: false), - CategoryName = c.String(), - Description = c.String(), - Picture = c.Binary(), - }) - .PrimaryKey(t => t.CategoryID); - - CreateTable( - "dbo.Customers", - c => new - { - CustomerID = c.String(nullable: false, maxLength: 128), - CompanyName = c.String(), - Address = c.String(), - City = c.String(), - Region = c.String(), - PostalCode = c.String(), - Country = c.String(), - ContactName = c.String(), - ContactTitle = c.String(), - Phone = c.String(), - Fax = c.String(), - }) - .PrimaryKey(t => t.CustomerID); - - CreateTable( - "dbo.Employees", - c => new - { - EmployeeID = c.Int(nullable: false), - LastName = c.String(nullable: false), - FirstName = c.String(nullable: false), - Title = c.String(maxLength: 30), - TitleOfCourtesy = c.String(), - BirthDate = c.DateTime(), - HireDate = c.DateTime(), - Address = c.String(), - City = c.String(), - Region = c.String(), - PostalCode = c.String(), - Country = c.String(), - HomePhone = c.String(maxLength: 24), - Extension = c.String(maxLength: 4), - Photo = c.Binary(), - PhotoPath = c.String(), - Notes = c.String(), - ReportsTo = c.Int(), - }) - .PrimaryKey(t => t.EmployeeID) - .ForeignKey("dbo.Employees", t => t.ReportsTo) - .Index(t => t.ReportsTo); - - CreateTable( - "dbo.Orders", - c => new - { - OrderID = c.Int(nullable: false), - OrderDate = c.DateTime(), - RequiredDate = c.DateTime(), - ShippedDate = c.DateTime(), - Freight = c.Decimal(precision: 18, scale: 2), - CustomerID = c.String(maxLength: 128), - EmployeeID = c.Int(), - ShipVia = c.Int(), - ShipName = c.String(), - ShipAddress = c.String(), - ShipCity = c.String(), - ShipRegion = c.String(), - ShipPostalCode = c.String(), - ShipCountry = c.String(), - }) - .PrimaryKey(t => t.OrderID) - .ForeignKey("dbo.Customers", t => t.CustomerID) - .ForeignKey("dbo.Employees", t => t.EmployeeID) - .Index(t => t.CustomerID) - .Index(t => t.EmployeeID); - - CreateTable( - "dbo.Order_Details", - c => new - { - OrderID = c.Int(nullable: false), - ProductID = c.Int(nullable: false), - UnitPrice = c.Decimal(nullable: false, precision: 18, scale: 2), - Quantity = c.Short(nullable: false), - Discount = c.Single(nullable: false), - }) - .PrimaryKey(t => new { t.OrderID, t.ProductID }) - .ForeignKey("dbo.Orders", t => t.OrderID, cascadeDelete: true) - .ForeignKey("dbo.Products", t => t.ProductID, cascadeDelete: true) - .Index(t => t.OrderID) - .Index(t => t.ProductID); - - CreateTable( - "dbo.Products", - c => new - { - ProductID = c.Int(nullable: false), - ProductName = c.String(), - SupplierID = c.Int(), - CategoryID = c.Int(), - QuantityPerUnit = c.String(), - UnitPrice = c.Decimal(precision: 18, scale: 2), - UnitsInStock = c.Short(), - UnitsOnOrder = c.Short(), - ReorderLevel = c.Short(), - Discontinued = c.Boolean(nullable: false), - }) - .PrimaryKey(t => t.ProductID) - .ForeignKey("dbo.Categories", t => t.CategoryID) - .ForeignKey("dbo.Suppliers", t => t.SupplierID) - .Index(t => t.SupplierID) - .Index(t => t.CategoryID); - - CreateTable( - "dbo.Suppliers", - c => new - { - SupplierID = c.Int(nullable: false, identity: true), - CompanyName = c.String(), - ContactName = c.String(), - ContactTitle = c.String(), - Address = c.String(), - City = c.String(), - Region = c.String(), - PostalCode = c.String(), - Country = c.String(), - Phone = c.String(), - Fax = c.String(), - HomePage = c.String(), - }) - .PrimaryKey(t => t.SupplierID); - - CreateTable( - "dbo.Shippers", - c => new - { - ShipperID = c.Int(nullable: false, identity: true), - CompanyName = c.String(), - Phone = c.String(), - }) - .PrimaryKey(t => t.ShipperID); - - } - - public override void Down() - { - DropForeignKey("dbo.Order_Details", "ProductID", "dbo.Products"); - DropForeignKey("dbo.Products", "SupplierID", "dbo.Suppliers"); - DropForeignKey("dbo.Products", "CategoryID", "dbo.Categories"); - DropForeignKey("dbo.Order_Details", "OrderID", "dbo.Orders"); - DropForeignKey("dbo.Orders", "EmployeeID", "dbo.Employees"); - DropForeignKey("dbo.Orders", "CustomerID", "dbo.Customers"); - DropForeignKey("dbo.Employees", "ReportsTo", "dbo.Employees"); - DropIndex("dbo.Products", new[] { "CategoryID" }); - DropIndex("dbo.Products", new[] { "SupplierID" }); - DropIndex("dbo.Order_Details", new[] { "ProductID" }); - DropIndex("dbo.Order_Details", new[] { "OrderID" }); - DropIndex("dbo.Orders", new[] { "EmployeeID" }); - DropIndex("dbo.Orders", new[] { "CustomerID" }); - DropIndex("dbo.Employees", new[] { "ReportsTo" }); - DropTable("dbo.Shippers"); - DropTable("dbo.Suppliers"); - DropTable("dbo.Products"); - DropTable("dbo.Order_Details"); - DropTable("dbo.Orders"); - DropTable("dbo.Employees"); - DropTable("dbo.Customers"); - DropTable("dbo.Categories"); - } - } -} diff --git a/AspNet4/Mvc/AdvancedSearch/Migrations/202101141900542_IntitalCreate.resx b/AspNet4/Mvc/AdvancedSearch/Migrations/202101141900542_IntitalCreate.resx deleted file mode 100644 index f0c0df5c..00000000 --- a/AspNet4/Mvc/AdvancedSearch/Migrations/202101141900542_IntitalCreate.resx +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms,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U6DhjK7CBm6rkaxlHx9kyHra+GTaso98Az95rzHttcpsBcic5LqFZo0l0ZT7YumYy32xdGTmD3HXgnGn5PawAeZd8m4jYFhvnRSoW04X73zO8i3tsrW0y7bTxYZEEEf6PEYcrN3ytrQfps1uC/PBmn5D1sNXQ0ZkRvbnElWxqk1uCzyVuqsX//EAlKDOxMflvdrI/UbYjhlBj5aMykkfhBjKhffWSwtaXkF32dV20gLTu0iuAneHu3hIe7DZ+d+GFbCf/2+NiXjD1MBaohl/Bkh/ssW+1L4+5IrfE50wY7Xi/YcL0a9CxORHJuvnQ8w0OC6H25wUQZt88xK5S8TAjNSLZ050oezdph60vHTgkv4YTQ++KYpfh+n77nyKy6QaU+mj+pVWqRti6VU50uSZ1NLvvraS71bnto8n0QM5bVE9UrfwFyoy6DOPKoNWaWUYaUNlESysVkSwKp0IMzenLKKO3BT8ulwHbiC61CI3a0eP39QapdwbmAdNrMBtpMA6ITcmNkIZnzkmRQCr0kkw80AqIhrWYFVCU6MVQHmIJfxNsg1riWE19sKUCrJovV1GYXmxi8R0bTcqLDCOZ2So2xuEMth/Hke+vcE5gbu7ag4MDBwH/W9VeXjqx/grez+RhbPtdiUzKrxJP9xtDsTnK9tk8ZXe7d3mKHS9Dl0eUYEdqHjV9+lwVLhOyVHH6tcZLOIFg5hhzBSGQjxIr7lIH7MmMpV61Fwi7aBc4luLcLB4kqP4EYQIV4ewKMrPT34Bybo0eg8wukiv12i1RviW4fIhEZYHCW/b5Jd8w2KfZ9fli1/FELeAuxmT06HX6Yd1nES03+eaXXwDBImb620uMpeIbHctXinSlfKupgmoHj4a7t9B7BwwWHGdzsEz9Onb5wJ+ggsQvt7Ur0WaQbonQhz22VkMFjlYFjUGa49/Yh2Oli8//x+XuC2CcqAAAA== - - - dbo - - \ No newline at end of file diff --git a/AspNet4/Mvc/AdvancedSearch/Migrations/Configuration.cs b/AspNet4/Mvc/AdvancedSearch/Migrations/Configuration.cs deleted file mode 100644 index 964fed20..00000000 --- a/AspNet4/Mvc/AdvancedSearch/Migrations/Configuration.cs +++ /dev/null @@ -1,34 +0,0 @@ -namespace EqDemo.Migrations -{ - using Korzh.DbUtils; - using System; - using System.Data.Entity; - using System.Data.Entity.Migrations; - using System.Linq; - - internal sealed class Configuration : DbMigrationsConfiguration - { - public Configuration() - { - AutomaticMigrationsEnabled = false; - ContextKey = "EqDemo.Models.ApplicationDbContext"; - } - - protected override void Seed(EqDemo.Models.ApplicationDbContext context) - { - // This method will be called after migrating to the latest version. - - // You can use the DbSet.AddOrUpdate() helper extension method - // to avoid creating duplicate seed data. - - if (context.Customers.Count() < 10) { - Korzh.DbUtils.DbInitializer.Create(options => { - options.UseSqlServer(context.Database.Connection.ConnectionString); - options.UseZipPacker(System.Web.Hosting.HostingEnvironment.MapPath("~/App_Data/EqDemoData.zip")); - }) - .Seed(); - } - } - - } -} diff --git a/AspNet4/Mvc/AdvancedSearch/Models/IdentityModels.cs b/AspNet4/Mvc/AdvancedSearch/Models/IdentityModels.cs deleted file mode 100644 index 21299219..00000000 --- a/AspNet4/Mvc/AdvancedSearch/Models/IdentityModels.cs +++ /dev/null @@ -1,76 +0,0 @@ -using System.Data.Entity; -using System.Security.Claims; -using System.Threading.Tasks; -using Microsoft.AspNet.Identity; -using Microsoft.AspNet.Identity.EntityFramework; - -namespace EqAspNet4Demo.Models -{ - // You can add profile data for the user by adding more properties to your ApplicationUser class, please visit https://go.microsoft.com/fwlink/?LinkID=317594 to learn more. - public class ApplicationUser : IdentityUser - { - public async Task GenerateUserIdentityAsync(UserManager manager) - { - // Note the authenticationType must match the one defined in CookieAuthenticationOptions.AuthenticationType - var userIdentity = await manager.CreateIdentityAsync(this, DefaultAuthenticationTypes.ApplicationCookie); - // Add custom user claims here - return userIdentity; - } - } - - public class ApplicationDbContext : IdentityDbContext - { - public ApplicationDbContext() - : base("DefaultConnection", throwIfV1Schema: false) - { - Database.SetInitializer(new NwindInitializer()); - } - - - - #region NWind - public DbSet Categories { get; set; } - - public DbSet Customers { get; set; } - - public DbSet Employees { get; set; } - - public DbSet Orders { get; set; } - - public DbSet Products { get; set; } - - public DbSet OrderDetails { get; set; } - - public DbSet Shippers { get; set; } - - public DbSet Suppliers { get; set; } - - #endregion - - protected override void OnModelCreating(DbModelBuilder modelBuilder) - { - base.OnModelCreating(modelBuilder); - - modelBuilder.Entity() - .ToTable("Order_Details") - .HasKey(od => new { od.OrderID, od.ProductID }); - } - - public static ApplicationDbContext Create() - { - return new ApplicationDbContext(); - } - - } - - public class NwindInitializer : CreateDatabaseIfNotExists - { - protected override void Seed(ApplicationDbContext context) - { - base.Seed(context); - - var initializer = new DbIntializer(context.Database.Connection.ConnectionString); - initializer.AddTestData(); - } - } -} \ No newline at end of file diff --git a/AspNet4/Mvc/AdvancedSearch/Program.cs b/AspNet4/Mvc/AdvancedSearch/Program.cs new file mode 100644 index 00000000..83414752 --- /dev/null +++ b/AspNet4/Mvc/AdvancedSearch/Program.cs @@ -0,0 +1,20 @@ +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Hosting; + +namespace EqDemo +{ + public class Program + { + public static void Main(string[] args) + { + CreateHostBuilder(args).Build().Run(); + } + + public static IHostBuilder CreateHostBuilder(string[] args) => + Host.CreateDefaultBuilder(args) + .ConfigureWebHostDefaults(webBuilder => + { + webBuilder.UseStartup(); + }); + } +} diff --git a/AspNet4/Mvc/AdvancedSearch/Properties/AssemblyInfo.cs b/AspNet4/Mvc/AdvancedSearch/Properties/AssemblyInfo.cs deleted file mode 100644 index aa631edf..00000000 --- a/AspNet4/Mvc/AdvancedSearch/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("EqDemo.AspNet4x.AdvancedSearch")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("EqDemo.AspNet4x.AdvancedSearch")] -[assembly: AssemblyCopyright("Copyright © 2021")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("3e7ea557-c95f-4b8b-942c-072b21fbc3ca")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/AspNet4/Mvc/AdvancedSearch/Startup.cs b/AspNet4/Mvc/AdvancedSearch/Startup.cs new file mode 100644 index 00000000..e9ad8866 --- /dev/null +++ b/AspNet4/Mvc/AdvancedSearch/Startup.cs @@ -0,0 +1,74 @@ +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; + +using Korzh.EasyQuery.Services; +using Korzh.EasyQuery.Db; + +using EqDemo.Models; + +namespace EqDemo +{ + public class Startup + { + public Startup(IConfiguration configuration) + { + Configuration = configuration; + DbConnectionString = Configuration.GetConnectionString("DefaultConnection"); + } + + public IConfiguration Configuration { get; } + public string DbConnectionString { get; } + + public void ConfigureServices(IServiceCollection services) + { + services.AddDbContext( + options => options.UseSqlServer(DbConnectionString) + ); + + services.AddDistributedMemoryCache(); + services.AddSession(); + + services.AddEasyQuery() + .UseSqlManager() + .AddDefaultExporters() + .RegisterDbGate(); + + services.AddControllersWithViews(); + } + + public void Configure(IApplicationBuilder app, IWebHostEnvironment env) + { + if (env.IsDevelopment()) { + app.UseDeveloperExceptionPage(); + } + else { + app.UseExceptionHandler("/Home/Error"); + app.UseHsts(); + } + + app.UseHttpsRedirection(); + app.UseStaticFiles(); + app.UseRouting(); + app.UseSession(); + + app.UseEndpoints(endpoints => { + endpoints.MapEasyQuery(options => { + options.DefaultModelId = "nwind"; + options.BuildQueryOnSync = true; + options.SaveNewQuery = false; + options.ConnectionString = DbConnectionString; + options.UseDbContext(); + options.UseQueryStore((_) => new FileQueryStore("App_Data")); + }); + + endpoints.MapControllerRoute( + name: "default", + pattern: "{controller=Home}/{action=Index}/{id?}"); + }); + } + } +} diff --git a/AspNet4/Mvc/AdvancedSearch/Views/Web.config b/AspNet4/Mvc/AdvancedSearch/Views/Web.config deleted file mode 100644 index ce5c70c7..00000000 --- a/AspNet4/Mvc/AdvancedSearch/Views/Web.config +++ /dev/null @@ -1,43 +0,0 @@ - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/AspNet4/Mvc/AdvancedSearch/Web.Debug.config b/AspNet4/Mvc/AdvancedSearch/Web.Debug.config deleted file mode 100644 index d7712aaf..00000000 --- a/AspNet4/Mvc/AdvancedSearch/Web.Debug.config +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - diff --git a/AspNet4/Mvc/AdvancedSearch/Web.Release.config b/AspNet4/Mvc/AdvancedSearch/Web.Release.config deleted file mode 100644 index 28a4d5fc..00000000 --- a/AspNet4/Mvc/AdvancedSearch/Web.Release.config +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - diff --git a/AspNet4/Mvc/AdvancedSearch/Web.config b/AspNet4/Mvc/AdvancedSearch/Web.config deleted file mode 100644 index f38e3945..00000000 --- a/AspNet4/Mvc/AdvancedSearch/Web.config +++ /dev/null @@ -1,122 +0,0 @@ - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/AspNet4/Mvc/AdvancedSearch/appsettings.json b/AspNet4/Mvc/AdvancedSearch/appsettings.json new file mode 100644 index 00000000..e12cd585 --- /dev/null +++ b/AspNet4/Mvc/AdvancedSearch/appsettings.json @@ -0,0 +1,14 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Warning" + } + }, + "AllowedHosts": "*", + "ConnectionStrings": { + "DefaultConnection": "Data Source=(localdb)\\MSSQLLocalDB;Initial Catalog=EqDemo.AspNet4x.AdvancedSearch;Integrated Security=True;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False" + }, + "EasyQuery": { + "LicenseKey": "" + } +} diff --git a/AspNet4/Mvc/DataFiltering/App_Start/BundleConfig.cs b/AspNet4/Mvc/DataFiltering/App_Start/BundleConfig.cs deleted file mode 100644 index 36869ed1..00000000 --- a/AspNet4/Mvc/DataFiltering/App_Start/BundleConfig.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Web; -using System.Web.Optimization; - -namespace EqDemo.AspNet4x.DataFiltering -{ - public class BundleConfig - { - public static void RegisterBundles(BundleCollection bundles) - { - } - } -} diff --git a/AspNet4/Mvc/DataFiltering/App_Start/FilterConfig.cs b/AspNet4/Mvc/DataFiltering/App_Start/FilterConfig.cs deleted file mode 100644 index cb889ae7..00000000 --- a/AspNet4/Mvc/DataFiltering/App_Start/FilterConfig.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Web; -using System.Web.Mvc; - -namespace EqDemo.AspNet4x.DataFiltering -{ - public class FilterConfig - { - public static void RegisterGlobalFilters(GlobalFilterCollection filters) - { - filters.Add(new HandleErrorAttribute()); - } - } -} diff --git a/AspNet4/Mvc/DataFiltering/App_Start/RouteConfig.cs b/AspNet4/Mvc/DataFiltering/App_Start/RouteConfig.cs deleted file mode 100644 index eb536a29..00000000 --- a/AspNet4/Mvc/DataFiltering/App_Start/RouteConfig.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web; -using System.Web.Mvc; -using System.Web.Routing; - -namespace EqDemo.AspNet4x.DataFiltering -{ - public class RouteConfig - { - public static void RegisterRoutes(RouteCollection routes) - { - routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); - - routes.MapMvcAttributeRoutes(); - - routes.MapRoute( - name: "Default", - url: "{controller}/{action}/{id}", - defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional } - ); - } - } -} diff --git a/AspNet4/Mvc/DataFiltering/Controllers/HomeController.cs b/AspNet4/Mvc/DataFiltering/Controllers/HomeController.cs index bb258458..30bdc506 100644 --- a/AspNet4/Mvc/DataFiltering/Controllers/HomeController.cs +++ b/AspNet4/Mvc/DataFiltering/Controllers/HomeController.cs @@ -1,16 +1,12 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web; -using System.Web.Mvc; +using Microsoft.AspNetCore.Mvc; namespace EqDemo.Controllers { public class HomeController : Controller { - public ActionResult Index() + public IActionResult Index() { return RedirectToAction("Index", "Order"); } } -} \ No newline at end of file +} diff --git a/AspNet4/Mvc/DataFiltering/Controllers/OrderController.cs b/AspNet4/Mvc/DataFiltering/Controllers/OrderController.cs index 5d0f35b9..fe083878 100644 --- a/AspNet4/Mvc/DataFiltering/Controllers/OrderController.cs +++ b/AspNet4/Mvc/DataFiltering/Controllers/OrderController.cs @@ -1,82 +1,69 @@ - using System; using System.Collections.Generic; +using System.IO; using System.Linq; using System.Threading.Tasks; -using System.Web; -using System.Web.Mvc; -using System.Data.Entity; + +using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; using Korzh.EasyQuery.Services; using Korzh.EasyQuery.Linq; -using Korzh.EasyQuery.AspNet; +using Korzh.EasyQuery.AspNetCore; using EqDemo.Models; namespace EqDemo.Controllers { - [RoutePrefix("data-filtering")] + [Route("data-filtering")] public class OrderController : Controller { EasyQueryManagerLinq _eqManager; ApplicationDbContext _dbContext; - public OrderController() + public OrderController(IServiceProvider services, ApplicationDbContext dbContext) { - _dbContext = ApplicationDbContext.Create(); + _dbContext = dbContext; var options = new EasyQueryOptions(); - options.UseEntity((_) => _dbContext.Orders); - - //create EasyQuery manager which generates LINQ queries - _eqManager = new EasyQueryManagerLinq(options); + options.UseEntity((_) => + _dbContext + .Orders + .Include(o => o.Customer) + .Include(o => o.Employee) + .AsQueryable()); + + _eqManager = new EasyQueryManagerLinq(options, services); } - // GET - [Route] - public ActionResult Index() + [HttpGet] + [Route("")] + public IActionResult Index() { return View("Orders"); } - /// - /// Gets the model by its ID - /// - /// The ID of the model that will be loaded - /// An ActionResult object with JSON representation of the model [HttpGet] [Route("models/{modelId}")] - public async Task GetModelAsync(string modelId) + public async Task GetModelAsync(string modelId) { var model = await _eqManager.GetModelAsync(modelId); - return this.EqOk(new { model }); + return this.EqOk(new { Model = model }); } - /// - /// This action returns a list values for specified value editor. - /// - /// The ID of the model the value editor belongs to. - /// The ID of the value editor. It can be any LIST value editor (SQL LIST, CONST LIST, etc). - /// A object with a JSON represantation of the list. [HttpGet] [Route("models/{modelId}/valuelists/{editorId}")] - public async Task GetList(string modelId, string editorId) + public async Task GetList(string modelId, string editorId) { var list = await _eqManager.GetValueListAsync(modelId, editorId); - - return this.EqOk(new { values = list }); + return this.EqOk(new { Values = list }); } - /// - /// This action is called when user clicks on "Apply" button in FilterBar or other data-filtering widget - /// - /// An ActionResult object that contains a partial view with the filtered result set. [HttpPost] [Route("models/{modelId}/fetch")] - public async Task ApplyQueryFilter(string modelId) + public async Task ApplyQueryFilter(string modelId) { - Request.InputStream.Position = 0; - await _eqManager.ReadRequestContentFromStreamAsync(modelId, Request.InputStream); + await _eqManager.ReadRequestContentFromStreamAsync(modelId, Request.Body); var orders = _dbContext.Orders .Include(o => o.Customer) @@ -87,13 +74,10 @@ public async Task ApplyQueryFilter(string modelId) var text = clientData != null && clientData.TryGetValue("text", out object value) ? (string)value : ""; - //read full-text search text if (!string.IsNullOrEmpty(text)) { var options = new FullTextSearchOptions { Depth = 2, - - // filter to use search for string fields we chose Filter = (propInfo) => { if (propInfo.DeclaringType == typeof(Order)) { @@ -114,14 +98,13 @@ public async Task ApplyQueryFilter(string modelId) orders = orders.FullTextSearchQuery(text, options); } - orders = orders .DynamicQuery(_eqManager.Query); var list = orders.ToPagedList(_eqManager.Chunk.Page, 15); ViewData["Text"] = text; - return View("_OrderListPartial", list); + return PartialView("_OrderListPartial", list); } } -} \ No newline at end of file +} diff --git a/AspNet4/Mvc/DataFiltering/Data/ApplicationDbContext.cs b/AspNet4/Mvc/DataFiltering/Data/ApplicationDbContext.cs index af7f2dd5..f9c17620 100644 --- a/AspNet4/Mvc/DataFiltering/Data/ApplicationDbContext.cs +++ b/AspNet4/Mvc/DataFiltering/Data/ApplicationDbContext.cs @@ -1,11 +1,11 @@ -using System.Data.Entity; +using Microsoft.EntityFrameworkCore; namespace EqDemo.Models { public class ApplicationDbContext : DbContext { - public ApplicationDbContext() - : base("DefaultConnection") + public ApplicationDbContext(DbContextOptions options) + : base(options) { } @@ -31,7 +31,7 @@ public ApplicationDbContext() #endregion - protected override void OnModelCreating(DbModelBuilder modelBuilder) + protected override void OnModelCreating(ModelBuilder modelBuilder) { base.OnModelCreating(modelBuilder); @@ -40,11 +40,6 @@ protected override void OnModelCreating(DbModelBuilder modelBuilder) .HasKey(od => new { od.OrderID, od.ProductID }); } - public static ApplicationDbContext Create() - { - return new ApplicationDbContext(); - } - } -} \ No newline at end of file +} diff --git a/AspNet4/Mvc/DataFiltering/EqDemo.AspNet4x.DataFiltering.csproj b/AspNet4/Mvc/DataFiltering/EqDemo.AspNet4x.DataFiltering.csproj index 41979379..46278b63 100644 --- a/AspNet4/Mvc/DataFiltering/EqDemo.AspNet4x.DataFiltering.csproj +++ b/AspNet4/Mvc/DataFiltering/EqDemo.AspNet4x.DataFiltering.csproj @@ -1,232 +1,25 @@ - - - - - - Debug - AnyCPU - - - 2.0 - {25B4D977-9D95-4133-B95F-A3C88830C21F} - {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - Library - Properties - EqDemo - EqDemo.AspNet4x.DataFiltering - v4.6.1 - false - true - - 44309 - - - - - - - - - true - full - false - bin\ - DEBUG;TRACE - prompt - 4 - - - true - pdbonly - true - bin\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - - - - - - - - - - - 13.0.3 - - - 4.8.6 - - - 1.6.0 - - - 5.2.7 - - - 5.2.7 - - - 5.2.7 - - - 3.2.7 - - - 3.2.7 - - - 1.1.3 - - - 1.0.0 - - - 6.2.0 - - - 2.0.0 - - - 3.5.1 - - - - - - - - - - - - - - - - - - - - - Global.asax - - - - 202101141900542_IntitalCreate.cs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Web.config - - - Web.config - - - - - - - - - - - - - - - - - - - - - - - 202101141900542_IntitalCreate.cs - - - - 10.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - - - - - - - - - True - True - 2460 - / - https://localhost:44309/ - False - False - - - False - - - - - - - - - - - - \ No newline at end of file + + + net8.0 + EqDemo + + + + + + + + + + + + + + + + + + PreserveNewest + + + diff --git a/AspNet4/Mvc/DataFiltering/Global.asax b/AspNet4/Mvc/DataFiltering/Global.asax deleted file mode 100644 index 3adddabe..00000000 --- a/AspNet4/Mvc/DataFiltering/Global.asax +++ /dev/null @@ -1 +0,0 @@ -<%@ Application Codebehind="Global.asax.cs" Inherits="EqDemo.AspNet4x.DataFiltering.MvcApplication" Language="C#" %> diff --git a/AspNet4/Mvc/DataFiltering/Global.asax.cs b/AspNet4/Mvc/DataFiltering/Global.asax.cs deleted file mode 100644 index 832ec38b..00000000 --- a/AspNet4/Mvc/DataFiltering/Global.asax.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Data.Entity.Migrations; -using System.Linq; -using System.Web; -using System.Web.Mvc; -using System.Web.Optimization; -using System.Web.Routing; - -using EqDemo.Migrations; - -namespace EqDemo.AspNet4x.DataFiltering -{ - public class MvcApplication : System.Web.HttpApplication - { - protected void Application_Start() - { - AreaRegistration.RegisterAllAreas(); - FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); - RouteConfig.RegisterRoutes(RouteTable.Routes); - BundleConfig.RegisterBundles(BundleTable.Bundles); - - // init db - var databaseMigrator = new DbMigrator(new Configuration()); - databaseMigrator.Update(); - } - } -} diff --git a/AspNet4/Mvc/DataFiltering/Migrations/202101141900542_IntitalCreate.Designer.cs b/AspNet4/Mvc/DataFiltering/Migrations/202101141900542_IntitalCreate.Designer.cs deleted file mode 100644 index 937c5cbf..00000000 --- a/AspNet4/Mvc/DataFiltering/Migrations/202101141900542_IntitalCreate.Designer.cs +++ /dev/null @@ -1,29 +0,0 @@ -// -namespace EqDemo.Migrations -{ - using System.CodeDom.Compiler; - using System.Data.Entity.Migrations; - using System.Data.Entity.Migrations.Infrastructure; - using System.Resources; - - [GeneratedCode("EntityFramework.Migrations", "6.2.0-61023")] - public sealed partial class IntitalCreate : IMigrationMetadata - { - private readonly ResourceManager Resources = new ResourceManager(typeof(IntitalCreate)); - - string IMigrationMetadata.Id - { - get { return "202101141900542_IntitalCreate"; } - } - - string IMigrationMetadata.Source - { - get { return null; } - } - - string IMigrationMetadata.Target - { - get { return Resources.GetString("Target"); } - } - } -} diff --git a/AspNet4/Mvc/DataFiltering/Migrations/202101141900542_IntitalCreate.cs b/AspNet4/Mvc/DataFiltering/Migrations/202101141900542_IntitalCreate.cs deleted file mode 100644 index 54dedd7d..00000000 --- a/AspNet4/Mvc/DataFiltering/Migrations/202101141900542_IntitalCreate.cs +++ /dev/null @@ -1,185 +0,0 @@ -namespace EqDemo.Migrations -{ - using System; - using System.Data.Entity.Migrations; - - public partial class IntitalCreate : DbMigration - { - public override void Up() - { - CreateTable( - "dbo.Categories", - c => new - { - CategoryID = c.Int(nullable: false), - CategoryName = c.String(), - Description = c.String(), - Picture = c.Binary(), - }) - .PrimaryKey(t => t.CategoryID); - - CreateTable( - "dbo.Customers", - c => new - { - CustomerID = c.String(nullable: false, maxLength: 128), - CompanyName = c.String(), - Address = c.String(), - City = c.String(), - Region = c.String(), - PostalCode = c.String(), - Country = c.String(), - ContactName = c.String(), - ContactTitle = c.String(), - Phone = c.String(), - Fax = c.String(), - }) - .PrimaryKey(t => t.CustomerID); - - CreateTable( - "dbo.Employees", - c => new - { - EmployeeID = c.Int(nullable: false), - LastName = c.String(nullable: false), - FirstName = c.String(nullable: false), - Title = c.String(maxLength: 30), - TitleOfCourtesy = c.String(), - BirthDate = c.DateTime(), - HireDate = c.DateTime(), - Address = c.String(), - City = c.String(), - Region = c.String(), - PostalCode = c.String(), - Country = c.String(), - HomePhone = c.String(maxLength: 24), - Extension = c.String(maxLength: 4), - Photo = c.Binary(), - PhotoPath = c.String(), - Notes = c.String(), - ReportsTo = c.Int(), - }) - .PrimaryKey(t => t.EmployeeID) - .ForeignKey("dbo.Employees", t => t.ReportsTo) - .Index(t => t.ReportsTo); - - CreateTable( - "dbo.Orders", - c => new - { - OrderID = c.Int(nullable: false), - OrderDate = c.DateTime(), - RequiredDate = c.DateTime(), - ShippedDate = c.DateTime(), - Freight = c.Decimal(precision: 18, scale: 2), - CustomerID = c.String(maxLength: 128), - EmployeeID = c.Int(), - ShipVia = c.Int(), - ShipName = c.String(), - ShipAddress = c.String(), - ShipCity = c.String(), - ShipRegion = c.String(), - ShipPostalCode = c.String(), - ShipCountry = c.String(), - }) - .PrimaryKey(t => t.OrderID) - .ForeignKey("dbo.Customers", t => t.CustomerID) - .ForeignKey("dbo.Employees", t => t.EmployeeID) - .Index(t => t.CustomerID) - .Index(t => t.EmployeeID); - - CreateTable( - "dbo.Order_Details", - c => new - { - OrderID = c.Int(nullable: false), - ProductID = c.Int(nullable: false), - UnitPrice = c.Decimal(nullable: false, precision: 18, scale: 2), - Quantity = c.Short(nullable: false), - Discount = c.Single(nullable: false), - }) - .PrimaryKey(t => new { t.OrderID, t.ProductID }) - .ForeignKey("dbo.Orders", t => t.OrderID, cascadeDelete: true) - .ForeignKey("dbo.Products", t => t.ProductID, cascadeDelete: true) - .Index(t => t.OrderID) - .Index(t => t.ProductID); - - CreateTable( - "dbo.Products", - c => new - { - ProductID = c.Int(nullable: false), - ProductName = c.String(), - SupplierID = c.Int(), - CategoryID = c.Int(), - QuantityPerUnit = c.String(), - UnitPrice = c.Decimal(precision: 18, scale: 2), - UnitsInStock = c.Short(), - UnitsOnOrder = c.Short(), - ReorderLevel = c.Short(), - Discontinued = c.Boolean(nullable: false), - }) - .PrimaryKey(t => t.ProductID) - .ForeignKey("dbo.Categories", t => t.CategoryID) - .ForeignKey("dbo.Suppliers", t => t.SupplierID) - .Index(t => t.SupplierID) - .Index(t => t.CategoryID); - - CreateTable( - "dbo.Suppliers", - c => new - { - SupplierID = c.Int(nullable: false, identity: true), - CompanyName = c.String(), - ContactName = c.String(), - ContactTitle = c.String(), - Address = c.String(), - City = c.String(), - Region = c.String(), - PostalCode = c.String(), - Country = c.String(), - Phone = c.String(), - Fax = c.String(), - HomePage = c.String(), - }) - .PrimaryKey(t => t.SupplierID); - - CreateTable( - "dbo.Shippers", - c => new - { - ShipperID = c.Int(nullable: false, identity: true), - CompanyName = c.String(), - Phone = c.String(), - }) - .PrimaryKey(t => t.ShipperID); - - } - - public override void Down() - { - DropForeignKey("dbo.Order_Details", "ProductID", "dbo.Products"); - DropForeignKey("dbo.Products", "SupplierID", "dbo.Suppliers"); - DropForeignKey("dbo.Products", "CategoryID", "dbo.Categories"); - DropForeignKey("dbo.Order_Details", "OrderID", "dbo.Orders"); - DropForeignKey("dbo.Orders", "EmployeeID", "dbo.Employees"); - DropForeignKey("dbo.Orders", "CustomerID", "dbo.Customers"); - DropForeignKey("dbo.Employees", "ReportsTo", "dbo.Employees"); - DropIndex("dbo.Products", new[] { "CategoryID" }); - DropIndex("dbo.Products", new[] { "SupplierID" }); - DropIndex("dbo.Order_Details", new[] { "ProductID" }); - DropIndex("dbo.Order_Details", new[] { "OrderID" }); - DropIndex("dbo.Orders", new[] { "EmployeeID" }); - DropIndex("dbo.Orders", new[] { "CustomerID" }); - DropIndex("dbo.Employees", new[] { "ReportsTo" }); - DropTable("dbo.Shippers"); - DropTable("dbo.Suppliers"); - DropTable("dbo.Products"); - DropTable("dbo.Order_Details"); - DropTable("dbo.Orders"); - DropTable("dbo.Employees"); - DropTable("dbo.Customers"); - DropTable("dbo.Categories"); - } - } -} diff --git a/AspNet4/Mvc/DataFiltering/Migrations/202101141900542_IntitalCreate.resx b/AspNet4/Mvc/DataFiltering/Migrations/202101141900542_IntitalCreate.resx deleted file mode 100644 index f0c0df5c..00000000 --- a/AspNet4/Mvc/DataFiltering/Migrations/202101141900542_IntitalCreate.resx +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - H4sIAAAAAAAEAO1d3W7juBW+L9B3EHzVFrNxklkU28DZRSaZdINOfhpnBr0LGIlxhJUlj0QHCYp9sl70kfoKJfXDf0okJdmeQZCbmBS/Q5GH5xwdUp/+95//zn55WSbBM8yLOEuPJwd7+5MApmEWxenieLJGjz/8NPnl5z/+YfYxWr4EX5rr3pPrcMu0OJ48IbQ6mk6L8AkuQbG3jMM8K7JHtBdmyymIsunh/v7fpgcHU4ghJhgrCGa36xTFS1j+wD9PszSEK7QGyWUWwaSoy3HNvEQNrsASFisQwuPJx69ncJntVRdOgpMkBrgTc5g8TgKQphkCCHfx6HMB5yjP0sV8hQtAcve6gvi6R5AUsO76Ebvc9i72D8ldTFnDBipcFyhbOgIevK+HZSo39xrcCR02PHAf8QCjV3LX5eAdT04Bgossf50EsrCj0yQnF0pju9e0eBfU5SfF6gqiH1/2TqJngGcsmkOQh0/vqF5g9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80AqIhrWYFVCU6MVQHmIJfxNsg1riWE19sKUCrJovV1GYXmxi8R0bTcqLDCOZ2So2xuEMth/Hke+vcE5gbu7ag4MDBwH/W9VeXjqx/grez+RhbPtdiUzKrxJP9xtDsTnK9tk8ZXe7d3mKHS9Dl0eUYEdqHjV9+lwVLhOyVHH6tcZLOIFg5hhzBSGQjxIr7lIH7MmMpV61Fwi7aBc4luLcLB4kqP4EYQIV4ewKMrPT34Bybo0eg8wukiv12i1RviW4fIhEZYHCW/b5Jd8w2KfZ9fli1/FELeAuxmT06HX6Yd1nES03+eaXXwDBImb620uMpeIbHctXinSlfKupgmoHj4a7t9B7BwwWHGdzsEz9Onb5wJ+ggsQvt7Ur0WaQbonQhz22VkMFjlYFjUGa49/Yh2Oli8//x+XuC2CcqAAAA== - - - dbo - - \ No newline at end of file diff --git a/AspNet4/Mvc/DataFiltering/Migrations/Configuration.cs b/AspNet4/Mvc/DataFiltering/Migrations/Configuration.cs deleted file mode 100644 index 1536764f..00000000 --- a/AspNet4/Mvc/DataFiltering/Migrations/Configuration.cs +++ /dev/null @@ -1,31 +0,0 @@ -namespace EqDemo.Migrations -{ - using Korzh.DbUtils; - using System; - using System.Data.Entity; - using System.Data.Entity.Migrations; - using System.Linq; - - internal sealed class Configuration : DbMigrationsConfiguration - { - public Configuration() - { - AutomaticMigrationsEnabled = false; - ContextKey = "EqDemo.Models.ApplicationDbContext"; - } - - protected override void Seed(EqDemo.Models.ApplicationDbContext context) - { - // This method will be called after migrating to the latest version. - - // You can use the DbSet.AddOrUpdate() helper extension method - // to avoid creating duplicate seed data. - - Korzh.DbUtils.DbInitializer.Create(options => { - options.UseSqlServer(context.Database.Connection.ConnectionString); - options.UseZipPacker(System.Web.Hosting.HostingEnvironment.MapPath("~/App_Data/EqDemoData.zip")); - }) - .Seed(); - } - } -} diff --git a/AspNet4/Mvc/DataFiltering/Program.cs b/AspNet4/Mvc/DataFiltering/Program.cs new file mode 100644 index 00000000..83414752 --- /dev/null +++ b/AspNet4/Mvc/DataFiltering/Program.cs @@ -0,0 +1,20 @@ +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Hosting; + +namespace EqDemo +{ + public class Program + { + public static void Main(string[] args) + { + CreateHostBuilder(args).Build().Run(); + } + + public static IHostBuilder CreateHostBuilder(string[] args) => + Host.CreateDefaultBuilder(args) + .ConfigureWebHostDefaults(webBuilder => + { + webBuilder.UseStartup(); + }); + } +} diff --git a/AspNet4/Mvc/DataFiltering/Properties/AssemblyInfo.cs b/AspNet4/Mvc/DataFiltering/Properties/AssemblyInfo.cs deleted file mode 100644 index 9f5a437f..00000000 --- a/AspNet4/Mvc/DataFiltering/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("EqDemo.AspNet4x.DataFiltering")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("EqDemo.AspNet4x.DataFiltering")] -[assembly: AssemblyCopyright("Copyright © 2021")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("9a9cd2e9-c947-463b-aa3f-b55cff9382a2")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/AspNet4/Mvc/DataFiltering/Startup.cs b/AspNet4/Mvc/DataFiltering/Startup.cs new file mode 100644 index 00000000..d9bbcf19 --- /dev/null +++ b/AspNet4/Mvc/DataFiltering/Startup.cs @@ -0,0 +1,55 @@ +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; + +using Korzh.EasyQuery.Services; + +using EqDemo.Models; + +namespace EqDemo +{ + public class Startup + { + public Startup(IConfiguration configuration) + { + Configuration = configuration; + DbConnectionString = Configuration.GetConnectionString("DefaultConnection"); + } + + public IConfiguration Configuration { get; } + public string DbConnectionString { get; } + + public void ConfigureServices(IServiceCollection services) + { + services.AddDbContext( + options => options.UseSqlServer(DbConnectionString) + ); + + services.AddControllersWithViews(); + } + + public void Configure(IApplicationBuilder app, IWebHostEnvironment env) + { + if (env.IsDevelopment()) { + app.UseDeveloperExceptionPage(); + } + else { + app.UseExceptionHandler("/Home/Error"); + app.UseHsts(); + } + + app.UseHttpsRedirection(); + app.UseStaticFiles(); + app.UseRouting(); + + app.UseEndpoints(endpoints => { + endpoints.MapControllerRoute( + name: "default", + pattern: "{controller=Home}/{action=Index}/{id?}"); + }); + } + } +} diff --git a/AspNet4/Mvc/DataFiltering/Views/Order/Orders.cshtml b/AspNet4/Mvc/DataFiltering/Views/Order/Orders.cshtml index 705e2c71..ba4d4778 100644 --- a/AspNet4/Mvc/DataFiltering/Views/Order/Orders.cshtml +++ b/AspNet4/Mvc/DataFiltering/Views/Order/Orders.cshtml @@ -1,4 +1,4 @@ -@using Korzh.EasyQuery.AspNet +@using Korzh.EasyQuery.AspNetCore @{ ViewData["Title"] = "Data Filtering demo"; ViewData["MenuTitle"] = "Data Filtering demo"; @@ -77,7 +77,7 @@ var view = new easyquery.ui.HtmlDataFilterView(); view.getContext() .useEndpoint('/data-filtering') - .useEnterprise('@Korzh.EasyQuery.AspNet.JSLicense.Key'); + .useEnterprise('@Korzh.EasyQuery.AspNetCore.JSLicense.Key'); view.init(viewOptions); diff --git a/AspNet4/Mvc/DataFiltering/Views/Order/_OrderListPartial.cshtml b/AspNet4/Mvc/DataFiltering/Views/Order/_OrderListPartial.cshtml index d7a377df..04461e14 100644 --- a/AspNet4/Mvc/DataFiltering/Views/Order/_OrderListPartial.cshtml +++ b/AspNet4/Mvc/DataFiltering/Views/Order/_OrderListPartial.cshtml @@ -1,6 +1,4 @@ -@using EqDemo.Models -@using Korzh.EasyQuery.AspNet -@model Korzh.EasyQuery.Services.IPagedList +@model Korzh.EasyQuery.Services.IPagedList @{ Layout = null; } @@ -33,13 +31,13 @@ @(item.OrderDate != null ? item.OrderDate.Value.ToString("yyyy-MM-dd") : "") - @Html.EqHighLightFor(item.Customer?.CompanyName ?? "", (string)@ViewBag.Text) + - @Html.EqHighLightFor(item.Customer?.Country ?? "", (string)@ViewBag.Text) + - @Html.EqHighLightFor(item.Employee.FullName, (string)@ViewBag.Text) + @@ -53,7 +51,7 @@
- @Html.PageNavigator(Model) +
@{ diff --git a/AspNet4/Mvc/DataFiltering/Views/Web.config b/AspNet4/Mvc/DataFiltering/Views/Web.config deleted file mode 100644 index 4d46efa2..00000000 --- a/AspNet4/Mvc/DataFiltering/Views/Web.config +++ /dev/null @@ -1,43 +0,0 @@ - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/AspNet4/Mvc/DataFiltering/Web.Debug.config b/AspNet4/Mvc/DataFiltering/Web.Debug.config deleted file mode 100644 index d7712aaf..00000000 --- a/AspNet4/Mvc/DataFiltering/Web.Debug.config +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - diff --git a/AspNet4/Mvc/DataFiltering/Web.Release.config b/AspNet4/Mvc/DataFiltering/Web.Release.config deleted file mode 100644 index 28a4d5fc..00000000 --- a/AspNet4/Mvc/DataFiltering/Web.Release.config +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - diff --git a/AspNet4/Mvc/DataFiltering/Web.config b/AspNet4/Mvc/DataFiltering/Web.config deleted file mode 100644 index e225fb61..00000000 --- a/AspNet4/Mvc/DataFiltering/Web.config +++ /dev/null @@ -1,304 +0,0 @@ - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/AspNet4/Mvc/DataFiltering/appsettings.json b/AspNet4/Mvc/DataFiltering/appsettings.json new file mode 100644 index 00000000..f4f3ad85 --- /dev/null +++ b/AspNet4/Mvc/DataFiltering/appsettings.json @@ -0,0 +1,14 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Warning" + } + }, + "AllowedHosts": "*", + "ConnectionStrings": { + "DefaultConnection": "Data Source=(localdb)\\MSSQLLocalDB;Initial Catalog=EqDemo.AspNet4x.DataFiltering;Integrated Security=True;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False" + }, + "EasyQuery": { + "LicenseKey": "" + } +} diff --git a/AspNet4/WebForms/AdvancedSearch/About.aspx b/AspNet4/WebForms/AdvancedSearch/About.aspx deleted file mode 100644 index 953637f4..00000000 --- a/AspNet4/WebForms/AdvancedSearch/About.aspx +++ /dev/null @@ -1,7 +0,0 @@ -<%@ Page Title="About" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="About.aspx.cs" Inherits="EqDemo.About" %> - - -

<%: Title %>.

-

Your application description page.

-

Use this area to provide additional information.

-
diff --git a/AspNet4/WebForms/AdvancedSearch/About.aspx.cs b/AspNet4/WebForms/AdvancedSearch/About.aspx.cs deleted file mode 100644 index 7aeb2202..00000000 --- a/AspNet4/WebForms/AdvancedSearch/About.aspx.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web; -using System.Web.UI; -using System.Web.UI.WebControls; - -namespace EqDemo -{ - public partial class About : Page - { - protected void Page_Load(object sender, EventArgs e) - { - - } - } -} \ No newline at end of file diff --git a/AspNet4/WebForms/AdvancedSearch/About.aspx.designer.cs b/AspNet4/WebForms/AdvancedSearch/About.aspx.designer.cs deleted file mode 100644 index 8f0cdffa..00000000 --- a/AspNet4/WebForms/AdvancedSearch/About.aspx.designer.cs +++ /dev/null @@ -1,17 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace EqDemo -{ - - - public partial class About - { - } -} diff --git a/AspNet4/WebForms/AdvancedSearch/App_Start/BundleConfig.cs b/AspNet4/WebForms/AdvancedSearch/App_Start/BundleConfig.cs deleted file mode 100644 index fb699b04..00000000 --- a/AspNet4/WebForms/AdvancedSearch/App_Start/BundleConfig.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web; -using System.Web.Optimization; -using System.Web.UI; - -namespace EqDemo -{ - public class BundleConfig - { - // For more information on Bundling, visit https://go.microsoft.com/fwlink/?LinkID=303951 - public static void RegisterBundles(BundleCollection bundles) - { - bundles.Add(new ScriptBundle("~/bundles/WebFormsJs").Include( - "~/Scripts/WebForms/WebForms.js", - "~/Scripts/WebForms/WebUIValidation.js", - "~/Scripts/WebForms/MenuStandards.js", - "~/Scripts/WebForms/Focus.js", - "~/Scripts/WebForms/GridView.js", - "~/Scripts/WebForms/DetailsView.js", - "~/Scripts/WebForms/TreeView.js", - "~/Scripts/WebForms/WebParts.js")); - - // Order is very important for these files to work, they have explicit dependencies - bundles.Add(new ScriptBundle("~/bundles/MsAjaxJs").Include( - "~/Scripts/WebForms/MsAjax/MicrosoftAjax.js", - "~/Scripts/WebForms/MsAjax/MicrosoftAjaxApplicationServices.js", - "~/Scripts/WebForms/MsAjax/MicrosoftAjaxTimer.js", - "~/Scripts/WebForms/MsAjax/MicrosoftAjaxWebForms.js")); - - // Use the Development version of Modernizr to develop with and learn from. Then, when you’re - // ready for production, use the build tool at https://modernizr.com to pick only the tests you need - //bundles.Add(new ScriptBundle("~/bundles/modernizr").Include( - // "~/Scripts/modernizr-*")); - } - } -} \ No newline at end of file diff --git a/AspNet4/WebForms/AdvancedSearch/App_Start/RouteConfig.cs b/AspNet4/WebForms/AdvancedSearch/App_Start/RouteConfig.cs deleted file mode 100644 index 46e2f1ef..00000000 --- a/AspNet4/WebForms/AdvancedSearch/App_Start/RouteConfig.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Web; -using System.Web.Routing; -using Microsoft.AspNet.FriendlyUrls; - -namespace EqDemo -{ - public static class RouteConfig - { - public static void RegisterRoutes(RouteCollection routes) - { - var settings = new FriendlyUrlSettings(); - settings.AutoRedirectMode = RedirectMode.Permanent; - routes.EnableFriendlyUrls(settings); - } - } -} diff --git a/AspNet4/WebForms/AdvancedSearch/App_Start/WebApiConfig.cs b/AspNet4/WebForms/AdvancedSearch/App_Start/WebApiConfig.cs deleted file mode 100644 index e14db9e0..00000000 --- a/AspNet4/WebForms/AdvancedSearch/App_Start/WebApiConfig.cs +++ /dev/null @@ -1,49 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web.Http; -using System.Web.Http.Controllers; -using System.Web.Http.Routing; - -using EasyData.Export; - -using Korzh.EasyQuery.Services; -using Korzh.EasyQuery.AspNet; - -namespace EqDemo -{ - public static class WebApiConfig - { - public static void Register(HttpConfiguration config) - { - // Web API configuration and services - var httpControllerRouteHandler = typeof(System.Web.Http.WebHost.HttpControllerRouteHandler).GetField("_instance", - System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic); - - // To support Session in WebAPI - if (httpControllerRouteHandler != null) - { - httpControllerRouteHandler.SetValue(null, - new Lazy(() => new SessionHttpControllerRouteHandler(), true)); - } - - // Web API routes - config.MapHttpAttributeRoutesWithEasyQuery(); - - config.Routes.MapHttpRoute( - name: "DefaultApi", - routeTemplate: "api/{controller}/{id}", - defaults: new { id = RouteParameter.Optional } - ); - - // Register you exportes here - // to make export works - EasyQueryManager.RegisterExporter("csv", new CsvDataExporter()); - EasyQueryManager.RegisterExporter("excel", new ExcelDataExporter()); - EasyQueryManager.RegisterExporter("pdf", new PdfDataExporter()); - - // Allows to use DbConnectionModelLoader - EasyQueryManagerSql.RegisterDbGate(); - } - } -} diff --git a/AspNet4/WebForms/AdvancedSearch/Bundle.config b/AspNet4/WebForms/AdvancedSearch/Bundle.config deleted file mode 100644 index de5e842a..00000000 --- a/AspNet4/WebForms/AdvancedSearch/Bundle.config +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/AspNet4/WebForms/AdvancedSearch/ConfigurationManagerExtensions.cs b/AspNet4/WebForms/AdvancedSearch/ConfigurationManagerExtensions.cs deleted file mode 100644 index add4e3a6..00000000 --- a/AspNet4/WebForms/AdvancedSearch/ConfigurationManagerExtensions.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Configuration; - - -namespace EqDemo -{ - public static class ConfigurationManagerWrapper - { - public static string GetConnectionString(string connectionStringId) - { - ConnectionStringSettings mySetting = ConfigurationManager.ConnectionStrings["DefaultConnection"]; - if (mySetting == null || string.IsNullOrEmpty(mySetting.ConnectionString)) - throw new Exception("Fatal error: missing connecting string in web.config file"); - - return mySetting.ConnectionString; - } - } -} \ No newline at end of file diff --git a/AspNet4/WebForms/AdvancedSearch/Contact.aspx b/AspNet4/WebForms/AdvancedSearch/Contact.aspx deleted file mode 100644 index a10273e9..00000000 --- a/AspNet4/WebForms/AdvancedSearch/Contact.aspx +++ /dev/null @@ -1,17 +0,0 @@ -<%@ Page Title="Contact" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Contact.aspx.cs" Inherits="EqDemo.Contact" %> - - -

<%: Title %>.

-

Your contact page.

-
- One Microsoft Way
- Redmond, WA 98052-6399
- P: - 425.555.0100 -
- -
- Support: Support@example.com
- Marketing: Marketing@example.com -
-
diff --git a/AspNet4/WebForms/AdvancedSearch/Contact.aspx.cs b/AspNet4/WebForms/AdvancedSearch/Contact.aspx.cs deleted file mode 100644 index ed97147c..00000000 --- a/AspNet4/WebForms/AdvancedSearch/Contact.aspx.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web; -using System.Web.UI; -using System.Web.UI.WebControls; - -namespace EqDemo -{ - public partial class Contact : Page - { - protected void Page_Load(object sender, EventArgs e) - { - - } - } -} \ No newline at end of file diff --git a/AspNet4/WebForms/AdvancedSearch/Contact.aspx.designer.cs b/AspNet4/WebForms/AdvancedSearch/Contact.aspx.designer.cs deleted file mode 100644 index 4f59e903..00000000 --- a/AspNet4/WebForms/AdvancedSearch/Contact.aspx.designer.cs +++ /dev/null @@ -1,17 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace EqDemo -{ - - - public partial class Contact - { - } -} diff --git a/AspNet4/WebForms/AdvancedSearch/Controllers/AdvancedSearchController.cs b/AspNet4/WebForms/AdvancedSearch/Controllers/AdvancedSearchController.cs deleted file mode 100644 index 1705ae2a..00000000 --- a/AspNet4/WebForms/AdvancedSearch/Controllers/AdvancedSearchController.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System.Web.Http; -using System.Data.SqlClient; - -using Korzh.EasyQuery.Services; -using Korzh.EasyQuery.AspNet; - -using EqDemo.Models; - -namespace EqDemo.Controllers -{ - [RoutePrefix("api/easyquery")] - public class AdvancedSearchController : EasyQueryApiController - { - - protected override void ConfigureEasyQueryOptions(EasyQueryOptions options) - { - options.UseManager(); - options.DefaultModelId = "nwind"; - options.BuildQueryOnSync = true; - - options.UseDbContext(ApplicationDbContext.Create()); - - // Uncomment the following 3 lines if you want to load model directly from the DB's meta-data - // (it's better to remove UseDbContext(..) call abouve in this case) - //options.ConnectionString = "Your connection string"; - //options.UseDbConnection(); - //options.UseDbConnectionModelLoader(); - - var path = System.Web.Hosting.HostingEnvironment.MapPath("~/App_Data"); - options.UseQueryStore((_) => new FileQueryStore(path)); - - options.AddPreFetchTuner(manager => { - //any code you would like to execute before the data is retrieved from the DB - }); - } - } -} \ No newline at end of file diff --git a/AspNet4/WebForms/AdvancedSearch/Data/ApplicationDbContext.cs b/AspNet4/WebForms/AdvancedSearch/Data/ApplicationDbContext.cs index af7f2dd5..3a29f8c3 100644 --- a/AspNet4/WebForms/AdvancedSearch/Data/ApplicationDbContext.cs +++ b/AspNet4/WebForms/AdvancedSearch/Data/ApplicationDbContext.cs @@ -1,17 +1,15 @@ -using System.Data.Entity; +using Microsoft.EntityFrameworkCore; namespace EqDemo.Models { public class ApplicationDbContext : DbContext { - public ApplicationDbContext() - : base("DefaultConnection") + public ApplicationDbContext(DbContextOptions options) + : base(options) { } - - #region NWind public DbSet Categories { get; set; } @@ -31,7 +29,7 @@ public ApplicationDbContext() #endregion - protected override void OnModelCreating(DbModelBuilder modelBuilder) + protected override void OnModelCreating(ModelBuilder modelBuilder) { base.OnModelCreating(modelBuilder); @@ -40,11 +38,6 @@ protected override void OnModelCreating(DbModelBuilder modelBuilder) .HasKey(od => new { od.OrderID, od.ProductID }); } - public static ApplicationDbContext Create() - { - return new ApplicationDbContext(); - } - } -} \ No newline at end of file +} diff --git a/AspNet4/WebForms/AdvancedSearch/Default.aspx b/AspNet4/WebForms/AdvancedSearch/Default.aspx deleted file mode 100644 index b6090970..00000000 --- a/AspNet4/WebForms/AdvancedSearch/Default.aspx +++ /dev/null @@ -1,11 +0,0 @@ -<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="EqDemo._Default" %> - - - -
-

EasyQuery

-

Demo program that shows the most common scenarios of using EasyQuery controls.

-

Open EasyQuery Demo

-
- -
diff --git a/AspNet4/WebForms/AdvancedSearch/Default.aspx.cs b/AspNet4/WebForms/AdvancedSearch/Default.aspx.cs deleted file mode 100644 index 85137d8a..00000000 --- a/AspNet4/WebForms/AdvancedSearch/Default.aspx.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web; -using System.Web.UI; -using System.Web.UI.WebControls; - -namespace EqDemo -{ - public partial class _Default : Page - { - protected void Page_Load(object sender, EventArgs e) - { - - } - } -} \ No newline at end of file diff --git a/AspNet4/WebForms/AdvancedSearch/Default.aspx.designer.cs b/AspNet4/WebForms/AdvancedSearch/Default.aspx.designer.cs deleted file mode 100644 index 55e3b992..00000000 --- a/AspNet4/WebForms/AdvancedSearch/Default.aspx.designer.cs +++ /dev/null @@ -1,17 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace EqDemo -{ - - - public partial class _Default - { - } -} diff --git a/AspNet4/WebForms/AdvancedSearch/EasyQuery.aspx b/AspNet4/WebForms/AdvancedSearch/EasyQuery.aspx deleted file mode 100644 index 955c2dd8..00000000 --- a/AspNet4/WebForms/AdvancedSearch/EasyQuery.aspx +++ /dev/null @@ -1,171 +0,0 @@ -<%@ Page Title="EasyQuery" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="EasyQuery.aspx.cs" Inherits="EqDemo.EasyQuery" %> - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
-
-
Entities
-
- -
-
-
- -
-
-
-
Columns
-
- -
-
-
-
-
-
Conditions
-
- -
-
-
-
- -
-
-
Query Menu
-
-
- - Clear - -
- Load -
-
-
- - - - - Fetch data - -
- -

- -
-
-
-
-
-
-
SQL
-
-
-
-
-
-
- -
-
-
-
-
-
diff --git a/AspNet4/WebForms/AdvancedSearch/EasyQuery.aspx.cs b/AspNet4/WebForms/AdvancedSearch/EasyQuery.aspx.cs deleted file mode 100644 index dfef4c8c..00000000 --- a/AspNet4/WebForms/AdvancedSearch/EasyQuery.aspx.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web; -using System.Web.UI; -using System.Web.UI.WebControls; - -namespace EqDemo -{ - public partial class EasyQuery : System.Web.UI.Page - { - protected void Page_Load(object sender, EventArgs e) - { - - } - } -} \ No newline at end of file diff --git a/AspNet4/WebForms/AdvancedSearch/EasyQuery.aspx.designer.cs b/AspNet4/WebForms/AdvancedSearch/EasyQuery.aspx.designer.cs deleted file mode 100644 index 700640c8..00000000 --- a/AspNet4/WebForms/AdvancedSearch/EasyQuery.aspx.designer.cs +++ /dev/null @@ -1,15 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace EqDemo { - - - public partial class EasyQuery { - } -} diff --git a/AspNet4/WebForms/AdvancedSearch/EqDemo.WebForms.AdvancedSearch.csproj b/AspNet4/WebForms/AdvancedSearch/EqDemo.WebForms.AdvancedSearch.csproj index da18db69..31b5af36 100644 --- a/AspNet4/WebForms/AdvancedSearch/EqDemo.WebForms.AdvancedSearch.csproj +++ b/AspNet4/WebForms/AdvancedSearch/EqDemo.WebForms.AdvancedSearch.csproj @@ -1,298 +1,30 @@ - - - - - - Debug - AnyCPU - - - 2.0 - {0907F31A-03D6-4A16-A16B-AB3AFC0C4E50} - {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - Library - Properties - EqDemo - EqDemo.WebForms.AdvancedSearch - v4.6.1 - true - - 44338 - - - - - - - 3.4 - - - true - full - false - bin\ - DEBUG;TRACE - prompt - 4 - - - true - pdbonly - true - bin\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - - - - - - - - - 3.5.1 - - - 2.1.7 - - - 6.34.0 - - - 13.0.3 - - - 4.8.6 - - - 4.7.2 - - - 6.34.0 - - - 1.6.0 - - - 1.14.3 - - - 3.4.1 - - - 3.4.1 - - - 3.7.1 - - - 3.4.1 - - - 1.0.2 - - - 1.1.3 - - - 1.1.1 - - - 2.0.1 - - - 5.0.0 - - - 5.0.0 - - - 1.0.0 - - - 5.2.7 - - - 5.2.7 - - - 6.2.0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - About.aspx - ASPXCodeBehind - - - About.aspx - - - - - - Contact.aspx - ASPXCodeBehind - - - Contact.aspx - - - - - Default.aspx - ASPXCodeBehind - - - Default.aspx - - - EasyQuery.aspx - ASPXCodeBehind - - - EasyQuery.aspx - - - Global.asax - - - - 202101141900542_IntitalCreate.cs - - - - - - - - - - - - - - Site.Master - ASPXCodeBehind - - - Site.Master - - - Site.Mobile.Master - ASPXCodeBehind - - - Site.Mobile.Master - - - ViewSwitcher.ascx - ASPXCodeBehind - - - ViewSwitcher.ascx - - - - - 202101141900542_IntitalCreate.cs - - - - - - - Web.config - - - Web.config - - - - - - - 10.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - - - - - - - True - True - 50333 - / - https://localhost:44338/ - False - False - - - False - - - - - - \ No newline at end of file + + + net8.0 + EqDemo + + + + + + + + + + + + + + + + + + + + + + + PreserveNewest + + + diff --git a/AspNet4/WebForms/AdvancedSearch/Global.asax b/AspNet4/WebForms/AdvancedSearch/Global.asax deleted file mode 100644 index dfba0d18..00000000 --- a/AspNet4/WebForms/AdvancedSearch/Global.asax +++ /dev/null @@ -1 +0,0 @@ -<%@ Application Codebehind="Global.asax.cs" Inherits="EqDemo.Global" Language="C#" %> diff --git a/AspNet4/WebForms/AdvancedSearch/Global.asax.cs b/AspNet4/WebForms/AdvancedSearch/Global.asax.cs deleted file mode 100644 index f03f736c..00000000 --- a/AspNet4/WebForms/AdvancedSearch/Global.asax.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web; -using System.Web.Optimization; -using System.Web.Routing; -using System.Web.Security; -using System.Web.SessionState; -using System.Web.Http; -using System.Data.Entity.Migrations; - -using EqDemo.Migrations; - -namespace EqDemo -{ - public class Global : HttpApplication - { - void Application_Start(object sender, EventArgs e) - { - // Code that runs on application startup - GlobalConfiguration.Configure(WebApiConfig.Register); - RouteConfig.RegisterRoutes(RouteTable.Routes); - BundleConfig.RegisterBundles(BundleTable.Bundles); - - // init db - var databaseMigrator = new DbMigrator(new Configuration()); - databaseMigrator.Update(); - } - } -} \ No newline at end of file diff --git a/AspNet4/WebForms/AdvancedSearch/Migrations/202101141900542_IntitalCreate.Designer.cs b/AspNet4/WebForms/AdvancedSearch/Migrations/202101141900542_IntitalCreate.Designer.cs deleted file mode 100644 index 937c5cbf..00000000 --- a/AspNet4/WebForms/AdvancedSearch/Migrations/202101141900542_IntitalCreate.Designer.cs +++ /dev/null @@ -1,29 +0,0 @@ -// -namespace EqDemo.Migrations -{ - using System.CodeDom.Compiler; - using System.Data.Entity.Migrations; - using System.Data.Entity.Migrations.Infrastructure; - using System.Resources; - - [GeneratedCode("EntityFramework.Migrations", "6.2.0-61023")] - public sealed partial class IntitalCreate : IMigrationMetadata - { - private readonly ResourceManager Resources = new ResourceManager(typeof(IntitalCreate)); - - string IMigrationMetadata.Id - { - get { return "202101141900542_IntitalCreate"; } - } - - string IMigrationMetadata.Source - { - get { return null; } - } - - string IMigrationMetadata.Target - { - get { return Resources.GetString("Target"); } - } - } -} diff --git a/AspNet4/WebForms/AdvancedSearch/Migrations/202101141900542_IntitalCreate.cs b/AspNet4/WebForms/AdvancedSearch/Migrations/202101141900542_IntitalCreate.cs deleted file mode 100644 index 54dedd7d..00000000 --- a/AspNet4/WebForms/AdvancedSearch/Migrations/202101141900542_IntitalCreate.cs +++ /dev/null @@ -1,185 +0,0 @@ -namespace EqDemo.Migrations -{ - using System; - using System.Data.Entity.Migrations; - - public partial class IntitalCreate : DbMigration - { - public override void Up() - { - CreateTable( - "dbo.Categories", - c => new - { - CategoryID = c.Int(nullable: false), - CategoryName = c.String(), - Description = c.String(), - Picture = c.Binary(), - }) - .PrimaryKey(t => t.CategoryID); - - CreateTable( - "dbo.Customers", - c => new - { - CustomerID = c.String(nullable: false, maxLength: 128), - CompanyName = c.String(), - Address = c.String(), - City = c.String(), - Region = c.String(), - PostalCode = c.String(), - Country = c.String(), - ContactName = c.String(), - ContactTitle = c.String(), - Phone = c.String(), - Fax = c.String(), - }) - .PrimaryKey(t => t.CustomerID); - - CreateTable( - "dbo.Employees", - c => new - { - EmployeeID = c.Int(nullable: false), - LastName = c.String(nullable: false), - FirstName = c.String(nullable: false), - Title = c.String(maxLength: 30), - TitleOfCourtesy = c.String(), - BirthDate = c.DateTime(), - HireDate = c.DateTime(), - Address = c.String(), - City = c.String(), - Region = c.String(), - PostalCode = c.String(), - Country = c.String(), - HomePhone = c.String(maxLength: 24), - Extension = c.String(maxLength: 4), - Photo = c.Binary(), - PhotoPath = c.String(), - Notes = c.String(), - ReportsTo = c.Int(), - }) - .PrimaryKey(t => t.EmployeeID) - .ForeignKey("dbo.Employees", t => t.ReportsTo) - .Index(t => t.ReportsTo); - - CreateTable( - "dbo.Orders", - c => new - { - OrderID = c.Int(nullable: false), - OrderDate = c.DateTime(), - RequiredDate = c.DateTime(), - ShippedDate = c.DateTime(), - Freight = c.Decimal(precision: 18, scale: 2), - CustomerID = c.String(maxLength: 128), - EmployeeID = c.Int(), - ShipVia = c.Int(), - ShipName = c.String(), - ShipAddress = c.String(), - ShipCity = c.String(), - ShipRegion = c.String(), - ShipPostalCode = c.String(), - ShipCountry = c.String(), - }) - .PrimaryKey(t => t.OrderID) - .ForeignKey("dbo.Customers", t => t.CustomerID) - .ForeignKey("dbo.Employees", t => t.EmployeeID) - .Index(t => t.CustomerID) - .Index(t => t.EmployeeID); - - CreateTable( - "dbo.Order_Details", - c => new - { - OrderID = c.Int(nullable: false), - ProductID = c.Int(nullable: false), - UnitPrice = c.Decimal(nullable: false, precision: 18, scale: 2), - Quantity = c.Short(nullable: false), - Discount = c.Single(nullable: false), - }) - .PrimaryKey(t => new { t.OrderID, t.ProductID }) - .ForeignKey("dbo.Orders", t => t.OrderID, cascadeDelete: true) - .ForeignKey("dbo.Products", t => t.ProductID, cascadeDelete: true) - .Index(t => t.OrderID) - .Index(t => t.ProductID); - - CreateTable( - "dbo.Products", - c => new - { - ProductID = c.Int(nullable: false), - ProductName = c.String(), - SupplierID = c.Int(), - CategoryID = c.Int(), - QuantityPerUnit = c.String(), - UnitPrice = c.Decimal(precision: 18, scale: 2), - UnitsInStock = c.Short(), - UnitsOnOrder = c.Short(), - ReorderLevel = c.Short(), - Discontinued = c.Boolean(nullable: false), - }) - .PrimaryKey(t => t.ProductID) - .ForeignKey("dbo.Categories", t => t.CategoryID) - .ForeignKey("dbo.Suppliers", t => t.SupplierID) - .Index(t => t.SupplierID) - .Index(t => t.CategoryID); - - CreateTable( - "dbo.Suppliers", - c => new - { - SupplierID = c.Int(nullable: false, identity: true), - CompanyName = c.String(), - ContactName = c.String(), - ContactTitle = c.String(), - Address = c.String(), - City = c.String(), - Region = c.String(), - PostalCode = c.String(), - Country = c.String(), - Phone = c.String(), - Fax = c.String(), - HomePage = c.String(), - }) - .PrimaryKey(t => t.SupplierID); - - CreateTable( - "dbo.Shippers", - c => new - { - ShipperID = c.Int(nullable: false, identity: true), - CompanyName = c.String(), - Phone = c.String(), - }) - .PrimaryKey(t => t.ShipperID); - - } - - public override void Down() - { - DropForeignKey("dbo.Order_Details", "ProductID", "dbo.Products"); - DropForeignKey("dbo.Products", "SupplierID", "dbo.Suppliers"); - DropForeignKey("dbo.Products", "CategoryID", "dbo.Categories"); - DropForeignKey("dbo.Order_Details", "OrderID", "dbo.Orders"); - DropForeignKey("dbo.Orders", "EmployeeID", "dbo.Employees"); - DropForeignKey("dbo.Orders", "CustomerID", "dbo.Customers"); - DropForeignKey("dbo.Employees", "ReportsTo", "dbo.Employees"); - DropIndex("dbo.Products", new[] { "CategoryID" }); - DropIndex("dbo.Products", new[] { "SupplierID" }); - DropIndex("dbo.Order_Details", new[] { "ProductID" }); - DropIndex("dbo.Order_Details", new[] { "OrderID" }); - DropIndex("dbo.Orders", new[] { "EmployeeID" }); - DropIndex("dbo.Orders", new[] { "CustomerID" }); - DropIndex("dbo.Employees", new[] { "ReportsTo" }); - DropTable("dbo.Shippers"); - DropTable("dbo.Suppliers"); - DropTable("dbo.Products"); - DropTable("dbo.Order_Details"); - DropTable("dbo.Orders"); - DropTable("dbo.Employees"); - DropTable("dbo.Customers"); - DropTable("dbo.Categories"); - } - } -} diff --git a/AspNet4/WebForms/AdvancedSearch/Migrations/202101141900542_IntitalCreate.resx b/AspNet4/WebForms/AdvancedSearch/Migrations/202101141900542_IntitalCreate.resx deleted file mode 100644 index f0c0df5c..00000000 --- a/AspNet4/WebForms/AdvancedSearch/Migrations/202101141900542_IntitalCreate.resx +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - H4sIAAAAAAAEAO1d3W7juBW+L9B3EHzVFrNxklkU28DZRSaZdINOfhpnBr0LGIlxhJUlj0QHCYp9sl70kfoKJfXDf0okJdmeQZCbmBS/Q5GH5xwdUp/+95//zn55WSbBM8yLOEuPJwd7+5MApmEWxenieLJGjz/8NPnl5z/+YfYxWr4EX5rr3pPrcMu0OJ48IbQ6mk6L8AkuQbG3jMM8K7JH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+NiXjD1MBaohl/Bkh/ssW+1L4+5IrfE50wY7Xi/YcL0a9CxORHJuvnQ8w0OC6H25wUQZt88xK5S8TAjNSLZ050oezdph60vHTgkv4YTQ++KYpfh+n77nyKy6QaU+mj+pVWqRti6VU50uSZ1NLvvraS71bnto8n0QM5bVE9UrfwFyoy6DOPKoNWaWUYaUNlESysVkSwKp0IMzenLKKO3BT8ulwHbiC61CI3a0eP39QapdwbmAdNrMBtpMA6ITcmNkIZnzkmRQCr0kkw80AqIhrWYFVCU6MVQHmIJfxNsg1riWE19sKUCrJovV1GYXmxi8R0bTcqLDCOZ2So2xuEMth/Hke+vcE5gbu7ag4MDBwH/W9VeXjqx/grez+RhbPtdiUzKrxJP9xtDsTnK9tk8ZXe7d3mKHS9Dl0eUYEdqHjV9+lwVLhOyVHH6tcZLOIFg5hhzBSGQjxIr7lIH7MmMpV61Fwi7aBc4luLcLB4kqP4EYQIV4ewKMrPT34Bybo0eg8wukiv12i1RviW4fIhEZYHCW/b5Jd8w2KfZ9fli1/FELeAuxmT06HX6Yd1nES03+eaXXwDBImb620uMpeIbHctXinSlfKupgmoHj4a7t9B7BwwWHGdzsEz9Onb5wJ+ggsQvt7Ur0WaQbonQhz22VkMFjlYFjUGa49/Yh2Oli8//x+XuC2CcqAAAA== - - - dbo - - \ No newline at end of file diff --git a/AspNet4/WebForms/AdvancedSearch/Migrations/Configuration.cs b/AspNet4/WebForms/AdvancedSearch/Migrations/Configuration.cs deleted file mode 100644 index 1536764f..00000000 --- a/AspNet4/WebForms/AdvancedSearch/Migrations/Configuration.cs +++ /dev/null @@ -1,31 +0,0 @@ -namespace EqDemo.Migrations -{ - using Korzh.DbUtils; - using System; - using System.Data.Entity; - using System.Data.Entity.Migrations; - using System.Linq; - - internal sealed class Configuration : DbMigrationsConfiguration - { - public Configuration() - { - AutomaticMigrationsEnabled = false; - ContextKey = "EqDemo.Models.ApplicationDbContext"; - } - - protected override void Seed(EqDemo.Models.ApplicationDbContext context) - { - // This method will be called after migrating to the latest version. - - // You can use the DbSet.AddOrUpdate() helper extension method - // to avoid creating duplicate seed data. - - Korzh.DbUtils.DbInitializer.Create(options => { - options.UseSqlServer(context.Database.Connection.ConnectionString); - options.UseZipPacker(System.Web.Hosting.HostingEnvironment.MapPath("~/App_Data/EqDemoData.zip")); - }) - .Seed(); - } - } -} diff --git a/AspNet4/WebForms/AdvancedSearch/Program.cs b/AspNet4/WebForms/AdvancedSearch/Program.cs new file mode 100644 index 00000000..83414752 --- /dev/null +++ b/AspNet4/WebForms/AdvancedSearch/Program.cs @@ -0,0 +1,20 @@ +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Hosting; + +namespace EqDemo +{ + public class Program + { + public static void Main(string[] args) + { + CreateHostBuilder(args).Build().Run(); + } + + public static IHostBuilder CreateHostBuilder(string[] args) => + Host.CreateDefaultBuilder(args) + .ConfigureWebHostDefaults(webBuilder => + { + webBuilder.UseStartup(); + }); + } +} diff --git a/AspNet4/WebForms/AdvancedSearch/Properties/AssemblyInfo.cs b/AspNet4/WebForms/AdvancedSearch/Properties/AssemblyInfo.cs deleted file mode 100644 index 9ec51ddf..00000000 --- a/AspNet4/WebForms/AdvancedSearch/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("EqWebFormsDemo")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("EqWebFormsDemo")] -[assembly: AssemblyCopyright("Copyright © 2019")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("0907f31a-03d6-4a16-a16b-ab3afc0c4e50")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/AspNet4/WebForms/AdvancedSearch/SessionControllerHandler.cs b/AspNet4/WebForms/AdvancedSearch/SessionControllerHandler.cs deleted file mode 100644 index 52b89b9b..00000000 --- a/AspNet4/WebForms/AdvancedSearch/SessionControllerHandler.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web; -using System.Web.Http.WebHost; -using System.Web.Routing; -using System.Web.SessionState; - -namespace EqDemo -{ - public class SessionControllerHandler : HttpControllerHandler, IRequiresSessionState - { - public SessionControllerHandler(RouteData routeData) - : base(routeData) - { } - } - - public class SessionHttpControllerRouteHandler : HttpControllerRouteHandler - { - protected override IHttpHandler GetHttpHandler(RequestContext requestContext) - { - return new SessionControllerHandler(requestContext.RouteData); - } - } -} \ No newline at end of file diff --git a/AspNet4/WebForms/AdvancedSearch/Site.Master b/AspNet4/WebForms/AdvancedSearch/Site.Master deleted file mode 100644 index 9808b176..00000000 --- a/AspNet4/WebForms/AdvancedSearch/Site.Master +++ /dev/null @@ -1,95 +0,0 @@ -<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Site.master.cs" Inherits="EqDemo.SiteMaster" %> - - - - - - - - <%: Page.Title %> - EasyQuery Demo Application - - - - - - - - - - - - - - - - -
- <%-- - - - <%--To learn more about bundling scripts in ScriptManager see https://go.microsoft.com/fwlink/?LinkID=301884 --%> - <%--Framework Scripts--%> - <%-- - - - - - - - - - - - - - - --%> - - -
- - -
-
-

© <%: DateTime.Now.Year %> - EasyQuery Demo Application

-
-
- -
- - - - - - - - - diff --git a/AspNet4/WebForms/AdvancedSearch/Site.Master.cs b/AspNet4/WebForms/AdvancedSearch/Site.Master.cs deleted file mode 100644 index 5e74f421..00000000 --- a/AspNet4/WebForms/AdvancedSearch/Site.Master.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web; -using System.Web.UI; -using System.Web.UI.WebControls; - -namespace EqDemo -{ - public partial class SiteMaster : MasterPage - { - protected void Page_Load(object sender, EventArgs e) - { - - } - } -} \ No newline at end of file diff --git a/AspNet4/WebForms/AdvancedSearch/Site.Master.designer.cs b/AspNet4/WebForms/AdvancedSearch/Site.Master.designer.cs deleted file mode 100644 index 1d09039a..00000000 --- a/AspNet4/WebForms/AdvancedSearch/Site.Master.designer.cs +++ /dev/null @@ -1,42 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace EqDemo { - - - public partial class SiteMaster { - - /// - /// StylesPlaceHolder control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.ContentPlaceHolder StylesPlaceHolder; - - /// - /// MainContent control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.ContentPlaceHolder MainContent; - - /// - /// ScriptsPlaceHolder control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.ContentPlaceHolder ScriptsPlaceHolder; - } -} diff --git a/AspNet4/WebForms/AdvancedSearch/Site.Mobile.Master b/AspNet4/WebForms/AdvancedSearch/Site.Mobile.Master deleted file mode 100644 index 4a297540..00000000 --- a/AspNet4/WebForms/AdvancedSearch/Site.Mobile.Master +++ /dev/null @@ -1,23 +0,0 @@ -<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Site.Mobile.master.cs" Inherits="EqDemo.Site_Mobile" %> -<%@ Register Src="~/ViewSwitcher.ascx" TagPrefix="friendlyUrls" TagName="ViewSwitcher" %> - - - - - - - - - -
-
-

Mobile Master Page

- -
- -
- -
-
- - diff --git a/AspNet4/WebForms/AdvancedSearch/Site.Mobile.Master.cs b/AspNet4/WebForms/AdvancedSearch/Site.Mobile.Master.cs deleted file mode 100644 index aaf37bbe..00000000 --- a/AspNet4/WebForms/AdvancedSearch/Site.Mobile.Master.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web; -using System.Web.UI; -using System.Web.UI.WebControls; - -namespace EqDemo -{ - public partial class Site_Mobile : System.Web.UI.MasterPage - { - protected void Page_Load(object sender, EventArgs e) - { - - } - } -} \ No newline at end of file diff --git a/AspNet4/WebForms/AdvancedSearch/Site.Mobile.Master.designer.cs b/AspNet4/WebForms/AdvancedSearch/Site.Mobile.Master.designer.cs deleted file mode 100644 index 0b8c5c31..00000000 --- a/AspNet4/WebForms/AdvancedSearch/Site.Mobile.Master.designer.cs +++ /dev/null @@ -1,51 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace EqDemo { - - - public partial class Site_Mobile { - - /// - /// HeadContent control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.ContentPlaceHolder HeadContent; - - /// - /// form1 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.HtmlControls.HtmlForm form1; - - /// - /// FeaturedContent control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.ContentPlaceHolder FeaturedContent; - - /// - /// MainContent control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.ContentPlaceHolder MainContent; - } -} diff --git a/AspNet4/WebForms/AdvancedSearch/Startup.cs b/AspNet4/WebForms/AdvancedSearch/Startup.cs new file mode 100644 index 00000000..34487de4 --- /dev/null +++ b/AspNet4/WebForms/AdvancedSearch/Startup.cs @@ -0,0 +1,72 @@ +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; + +using Korzh.EasyQuery.Services; +using Korzh.EasyQuery.Db; + +using EqDemo.Models; + +namespace EqDemo +{ + public class Startup + { + public Startup(IConfiguration configuration) + { + Configuration = configuration; + DbConnectionString = Configuration.GetConnectionString("DefaultConnection"); + } + + public IConfiguration Configuration { get; } + public string DbConnectionString { get; } + + public void ConfigureServices(IServiceCollection services) + { + services.AddDbContext( + options => options.UseSqlServer(DbConnectionString) + ); + + services.AddDistributedMemoryCache(); + services.AddSession(); + + services.AddEasyQuery() + .UseSqlManager() + .AddDefaultExporters() + .RegisterDbGate(); + + services.AddRazorPages(); + } + + public void Configure(IApplicationBuilder app, IWebHostEnvironment env) + { + if (env.IsDevelopment()) { + app.UseDeveloperExceptionPage(); + } + else { + app.UseExceptionHandler("/Error"); + app.UseHsts(); + } + + app.UseHttpsRedirection(); + app.UseStaticFiles(); + app.UseRouting(); + app.UseSession(); + + app.UseEndpoints(endpoints => { + endpoints.MapEasyQuery(options => { + options.DefaultModelId = "nwind"; + options.BuildQueryOnSync = true; + options.SaveNewQuery = false; + options.ConnectionString = DbConnectionString; + options.UseDbContext(); + options.UseQueryStore((_) => new FileQueryStore("App_Data")); + }); + + endpoints.MapRazorPages(); + }); + } + } +} diff --git a/AspNet4/WebForms/AdvancedSearch/ViewSwitcher.ascx b/AspNet4/WebForms/AdvancedSearch/ViewSwitcher.ascx deleted file mode 100644 index 12037b38..00000000 --- a/AspNet4/WebForms/AdvancedSearch/ViewSwitcher.ascx +++ /dev/null @@ -1,4 +0,0 @@ -<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ViewSwitcher.ascx.cs" Inherits="EqDemo.ViewSwitcher" %> -
- <%: CurrentView %> view | Switch to <%: AlternateView %> -
\ No newline at end of file diff --git a/AspNet4/WebForms/AdvancedSearch/ViewSwitcher.ascx.cs b/AspNet4/WebForms/AdvancedSearch/ViewSwitcher.ascx.cs deleted file mode 100644 index 99427ac9..00000000 --- a/AspNet4/WebForms/AdvancedSearch/ViewSwitcher.ascx.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web; -using System.Web.Routing; -using System.Web.UI; -using System.Web.UI.WebControls; -using Microsoft.AspNet.FriendlyUrls.Resolvers; - -namespace EqDemo -{ - public partial class ViewSwitcher : System.Web.UI.UserControl - { - protected string CurrentView { get; private set; } - - protected string AlternateView { get; private set; } - - protected string SwitchUrl { get; private set; } - - protected void Page_Load(object sender, EventArgs e) - { - // Determine current view - var isMobile = WebFormsFriendlyUrlResolver.IsMobileView(new HttpContextWrapper(Context)); - CurrentView = isMobile ? "Mobile" : "Desktop"; - - // Determine alternate view - AlternateView = isMobile ? "Desktop" : "Mobile"; - - // Create switch URL from the route, e.g. ~/__FriendlyUrls_SwitchView/Mobile?ReturnUrl=/Page - var switchViewRouteName = "AspNet.FriendlyUrls.SwitchView"; - var switchViewRoute = RouteTable.Routes[switchViewRouteName]; - if (switchViewRoute == null) - { - // Friendly URLs is not enabled or the name of the switch view route is out of sync - this.Visible = false; - return; - } - var url = GetRouteUrl(switchViewRouteName, new { view = AlternateView, __FriendlyUrls_SwitchViews = true }); - url += "?ReturnUrl=" + HttpUtility.UrlEncode(Request.RawUrl); - SwitchUrl = url; - } - } -} \ No newline at end of file diff --git a/AspNet4/WebForms/AdvancedSearch/ViewSwitcher.ascx.designer.cs b/AspNet4/WebForms/AdvancedSearch/ViewSwitcher.ascx.designer.cs deleted file mode 100644 index 7c7ec5fd..00000000 --- a/AspNet4/WebForms/AdvancedSearch/ViewSwitcher.ascx.designer.cs +++ /dev/null @@ -1,15 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace EqDemo { - - - public partial class ViewSwitcher { - } -} diff --git a/AspNet4/WebForms/AdvancedSearch/Web.Debug.config b/AspNet4/WebForms/AdvancedSearch/Web.Debug.config deleted file mode 100644 index fae9cfef..00000000 --- a/AspNet4/WebForms/AdvancedSearch/Web.Debug.config +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/AspNet4/WebForms/AdvancedSearch/Web.Release.config b/AspNet4/WebForms/AdvancedSearch/Web.Release.config deleted file mode 100644 index da6e960b..00000000 --- a/AspNet4/WebForms/AdvancedSearch/Web.Release.config +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/AspNet4/WebForms/AdvancedSearch/Web.config b/AspNet4/WebForms/AdvancedSearch/Web.config deleted file mode 100644 index 4100e5e2..00000000 --- a/AspNet4/WebForms/AdvancedSearch/Web.config +++ /dev/null @@ -1,309 +0,0 @@ - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/AspNet4/WebForms/AdvancedSearch/appsettings.json b/AspNet4/WebForms/AdvancedSearch/appsettings.json new file mode 100644 index 00000000..ff86450c --- /dev/null +++ b/AspNet4/WebForms/AdvancedSearch/appsettings.json @@ -0,0 +1,14 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Warning" + } + }, + "AllowedHosts": "*", + "ConnectionStrings": { + "DefaultConnection": "Data Source=(localdb)\\MSSQLLocalDB;Initial Catalog=EqDemo.WebForms.AdvancedSearch;Integrated Security=True;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False" + }, + "EasyQuery": { + "LicenseKey": "" + } +} diff --git a/AspNet4/WebForms/VB.AdvancedSearch/About.aspx b/AspNet4/WebForms/VB.AdvancedSearch/About.aspx deleted file mode 100644 index 4d1f4419..00000000 --- a/AspNet4/WebForms/VB.AdvancedSearch/About.aspx +++ /dev/null @@ -1,7 +0,0 @@ -<%@ Page Title="About" Language="VB" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="About.aspx.vb" Inherits="EqDemo.About" %> - - -

<%: Title %>.

-

Your app description page.

-

Use this area to provide additional information.

-
diff --git a/AspNet4/WebForms/VB.AdvancedSearch/About.aspx.designer.vb b/AspNet4/WebForms/VB.AdvancedSearch/About.aspx.designer.vb deleted file mode 100644 index e89b400d..00000000 --- a/AspNet4/WebForms/VB.AdvancedSearch/About.aspx.designer.vb +++ /dev/null @@ -1,15 +0,0 @@ -'------------------------------------------------------------------------------ -' -' This code was generated by a tool. -' -' Changes to this file may cause incorrect behavior and will be lost if -' the code is regenerated. -' -'------------------------------------------------------------------------------ - -Option Strict On -Option Explicit On - - -Partial Public Class About -End Class diff --git a/AspNet4/WebForms/VB.AdvancedSearch/About.aspx.vb b/AspNet4/WebForms/VB.AdvancedSearch/About.aspx.vb deleted file mode 100644 index a52b937d..00000000 --- a/AspNet4/WebForms/VB.AdvancedSearch/About.aspx.vb +++ /dev/null @@ -1,10 +0,0 @@ -Imports System -Imports System.Web.UI - -Public Class About - Inherits Page - - Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load - - End Sub -End Class \ No newline at end of file diff --git a/AspNet4/WebForms/VB.AdvancedSearch/App_Start/BundleConfig.vb b/AspNet4/WebForms/VB.AdvancedSearch/App_Start/BundleConfig.vb deleted file mode 100644 index 7e80297e..00000000 --- a/AspNet4/WebForms/VB.AdvancedSearch/App_Start/BundleConfig.vb +++ /dev/null @@ -1,31 +0,0 @@ -Imports System.Collections.Generic -Imports System.Linq -Imports System.Web -Imports System.Web.Optimization - -Public Class BundleConfig - ' For more information on Bundling, visit https://go.microsoft.com/fwlink/?LinkID=303951 - Public Shared Sub RegisterBundles(ByVal bundles As BundleCollection) - bundles.Add(New ScriptBundle("~/bundles/WebFormsJs").Include( - "~/Scripts/WebForms/WebForms.js", - "~/Scripts/WebForms/WebUIValidation.js", - "~/Scripts/WebForms/MenuStandards.js", - "~/Scripts/WebForms/Focus.js", - "~/Scripts/WebForms/GridView.js", - "~/Scripts/WebForms/DetailsView.js", - "~/Scripts/WebForms/TreeView.js", - "~/Scripts/WebForms/WebParts.js")) - - ' Order is very important for these files to work, they have explicit dependencies - bundles.Add(New ScriptBundle("~/bundles/MsAjaxJs").Include( - "~/Scripts/WebForms/MsAjax/MicrosoftAjax.js", - "~/Scripts/WebForms/MsAjax/MicrosoftAjaxApplicationServices.js", - "~/Scripts/WebForms/MsAjax/MicrosoftAjaxTimer.js", - "~/Scripts/WebForms/MsAjax/MicrosoftAjaxWebForms.js")) - - ' Use the Development version of Modernizr to develop with and learn from. Then, when you’re - ' ready for production, use the build tool at https://modernizr.com to pick only the tests you need - ' bundles.Add(New ScriptBundle("~/bundles/modernizr").Include( - ' "~/Scripts/modernizr-*")) - End Sub -End Class diff --git a/AspNet4/WebForms/VB.AdvancedSearch/App_Start/RouteConfig.vb b/AspNet4/WebForms/VB.AdvancedSearch/App_Start/RouteConfig.vb deleted file mode 100644 index 1e95fb43..00000000 --- a/AspNet4/WebForms/VB.AdvancedSearch/App_Start/RouteConfig.vb +++ /dev/null @@ -1,11 +0,0 @@ -Imports System.Web.Routing -Imports Microsoft.AspNet.FriendlyUrls - -Public Module RouteConfig - Sub RegisterRoutes(ByVal routes As RouteCollection) - Dim settings As FriendlyUrlSettings = New FriendlyUrlSettings() With { - .AutoRedirectMode = RedirectMode.Permanent - } - routes.EnableFriendlyUrls(settings) - End Sub -End Module diff --git a/AspNet4/WebForms/VB.AdvancedSearch/App_Start/WebApiConfig.vb b/AspNet4/WebForms/VB.AdvancedSearch/App_Start/WebApiConfig.vb deleted file mode 100644 index a029aa7a..00000000 --- a/AspNet4/WebForms/VB.AdvancedSearch/App_Start/WebApiConfig.vb +++ /dev/null @@ -1,39 +0,0 @@ -Imports System.Collections.Generic -Imports System.Collections.ObjectModel -Imports System.Web.Http -Imports System.Web.Http.Controllers -Imports System.Web.Http.Routing - -Imports EasyData.Export - -Imports Korzh.EasyQuery.Services -Imports Korzh.EasyQuery.AspNet - -Public Module WebApiConfig - Public Sub Register(ByVal config As HttpConfiguration) - - ' Web API configuration and services - ' Web API routes - ' Dim customRouteProvider As New WebApiCustomDirectRouteProvider - ' config.MapHttpAttributeRoutes(customRouteProvider) - config.MapHttpAttributeRoutesWithEasyQuery() - - config.Routes.MapHttpRoute( - name:="DefaultApi", - routeTemplate:="api/{controller}/{id}", - defaults:=New With {.id = RouteParameter.Optional} - ) - - ' Register you exportes here - ' to make export works - EasyQueryManager.RegisterExporter("csv", New CsvDataExporter()) - EasyQueryManager.RegisterExporter("excel", New ExcelDataExporter()) - EasyQueryManager.RegisterExporter("pdf", New PdfDataExporter()) - - ' Uncomment this line to enable model loading from DbConnection - ' EasyQueryManagerSql.RegisterDbGate(Of Korzh.EasyQuery.DbGates.SqlServerGate)(); - - End Sub -End Module - - diff --git a/AspNet4/WebForms/VB.AdvancedSearch/Bundle.config b/AspNet4/WebForms/VB.AdvancedSearch/Bundle.config deleted file mode 100644 index de5e842a..00000000 --- a/AspNet4/WebForms/VB.AdvancedSearch/Bundle.config +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/AspNet4/WebForms/VB.AdvancedSearch/Contact.aspx b/AspNet4/WebForms/VB.AdvancedSearch/Contact.aspx deleted file mode 100644 index af50a823..00000000 --- a/AspNet4/WebForms/VB.AdvancedSearch/Contact.aspx +++ /dev/null @@ -1,18 +0,0 @@ -<%@ Page Title="Contact" Language="VB" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Contact.aspx.vb" Inherits="EqDemo.Contact" %> - - -

<%: Title %>

-

Your contact page.

- -
- One Microsoft Way
- Redmond, WA 98052-6399
- P: - 425.555.0100 -
- -
- Support:Support@example.com
- Marketing:Marketing@example.com -
-
diff --git a/AspNet4/WebForms/VB.AdvancedSearch/Contact.aspx.designer.vb b/AspNet4/WebForms/VB.AdvancedSearch/Contact.aspx.designer.vb deleted file mode 100644 index ea75fe2f..00000000 --- a/AspNet4/WebForms/VB.AdvancedSearch/Contact.aspx.designer.vb +++ /dev/null @@ -1,15 +0,0 @@ -'------------------------------------------------------------------------------ -' -' This code was generated by a tool. -' -' Changes to this file may cause incorrect behavior and will be lost if -' the code is regenerated. -' -'------------------------------------------------------------------------------ - -Option Strict On -Option Explicit On - - -Partial Public Class Contact -End Class diff --git a/AspNet4/WebForms/VB.AdvancedSearch/Contact.aspx.vb b/AspNet4/WebForms/VB.AdvancedSearch/Contact.aspx.vb deleted file mode 100644 index f24410d0..00000000 --- a/AspNet4/WebForms/VB.AdvancedSearch/Contact.aspx.vb +++ /dev/null @@ -1,10 +0,0 @@ -Imports System -Imports System.Web.UI - -Public Class Contact - Inherits Page - - Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load - - End Sub -End Class \ No newline at end of file diff --git a/AspNet4/WebForms/VB.AdvancedSearch/Controllers/AdvancedSearchController.vb b/AspNet4/WebForms/VB.AdvancedSearch/Controllers/AdvancedSearchController.vb deleted file mode 100644 index bc26f2cd..00000000 --- a/AspNet4/WebForms/VB.AdvancedSearch/Controllers/AdvancedSearchController.vb +++ /dev/null @@ -1,25 +0,0 @@ -Imports System -Imports System.Configuration -Imports System.Data.SqlClient -Imports System.Web.Http - -Imports Korzh.EasyQuery.AspNet -Imports Korzh.EasyQuery.Services - - -Public Class AdvancedSearchController : Inherits EasyQueryApiController - - Protected Overrides Sub ConfigureEasyQueryOptions(options As EasyQueryOptions) - options.UseManager(Of EasyQueryManagerSql)() - - options.DefaultModelId = "nwind" - options.BuildQueryOnSync = True - - options.UseDbContext(ApplicationDbContext.Create()) - ' Do Not forget to uncomment SqlClientGate registration in WebApiConfig.cs file - ' options.UseDbConnectionModelLoader(); - - Dim path = System.Web.Hosting.HostingEnvironment.MapPath("~/App_Data") - options.UseQueryStore(Function(__) New FileQueryStore(path)) - End Sub -End Class diff --git a/AspNet4/WebForms/VB.AdvancedSearch/Data/ApplicationDbContext.cs b/AspNet4/WebForms/VB.AdvancedSearch/Data/ApplicationDbContext.cs new file mode 100644 index 00000000..3a29f8c3 --- /dev/null +++ b/AspNet4/WebForms/VB.AdvancedSearch/Data/ApplicationDbContext.cs @@ -0,0 +1,43 @@ +using Microsoft.EntityFrameworkCore; + +namespace EqDemo.Models +{ + public class ApplicationDbContext : DbContext + { + public ApplicationDbContext(DbContextOptions options) + : base(options) + { + + } + + #region NWind + public DbSet Categories { get; set; } + + public DbSet Customers { get; set; } + + public DbSet Employees { get; set; } + + public DbSet Orders { get; set; } + + public DbSet Products { get; set; } + + public DbSet OrderDetails { get; set; } + + public DbSet Shippers { get; set; } + + public DbSet Suppliers { get; set; } + + #endregion + + protected override void OnModelCreating(ModelBuilder modelBuilder) + { + base.OnModelCreating(modelBuilder); + + modelBuilder.Entity() + .ToTable("Order_Details") + .HasKey(od => new { od.OrderID, od.ProductID }); + } + + } + +} diff --git a/AspNet4/WebForms/VB.AdvancedSearch/Data/ApplicationDbContext.vb b/AspNet4/WebForms/VB.AdvancedSearch/Data/ApplicationDbContext.vb deleted file mode 100644 index 96f574ed..00000000 --- a/AspNet4/WebForms/VB.AdvancedSearch/Data/ApplicationDbContext.vb +++ /dev/null @@ -1,28 +0,0 @@ -Imports System.Data.Entity - -Public Class ApplicationDbContext - Inherits DbContext - - Public Sub New() - MyBase.New("DefaultConnection") - End Sub - - Public Property Categories As DbSet(Of Category) - Public Property Customers As DbSet(Of Customer) - Public Property Employees As DbSet(Of Employee) - Public Property Orders As DbSet(Of Order) - Public Property Products As DbSet(Of Product) - Public Property OrderDetails As DbSet(Of OrderDetail) - Public Property Shippers As DbSet(Of Shipper) - Public Property Suppliers As DbSet(Of Supplier) - - Protected Overrides Sub OnModelCreating(ByVal modelBuilder As DbModelBuilder) - MyBase.OnModelCreating(modelBuilder) - modelBuilder.Entity(Of OrderDetail)().ToTable("Order_Details").HasKey(Function(od) New With {od.OrderID, od.ProductID - }) - End Sub - - Public Shared Function Create() As ApplicationDbContext - Return New ApplicationDbContext() - End Function -End Class \ No newline at end of file diff --git a/AspNet4/WebForms/VB.AdvancedSearch/Default.aspx b/AspNet4/WebForms/VB.AdvancedSearch/Default.aspx deleted file mode 100644 index c71adbf3..00000000 --- a/AspNet4/WebForms/VB.AdvancedSearch/Default.aspx +++ /dev/null @@ -1,11 +0,0 @@ -<%@ Page Title="Home Page" Language="VB" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Default.aspx.vb" Inherits="EqDemo._Default" %> - - - -
-

EasyQuery

-

Demo program that shows the most common scenarios of using EasyQuery controls.

-

Open EasyQuery Demo

-
- -
diff --git a/AspNet4/WebForms/VB.AdvancedSearch/Default.aspx.designer.vb b/AspNet4/WebForms/VB.AdvancedSearch/Default.aspx.designer.vb deleted file mode 100644 index acf75d94..00000000 --- a/AspNet4/WebForms/VB.AdvancedSearch/Default.aspx.designer.vb +++ /dev/null @@ -1,15 +0,0 @@ -'------------------------------------------------------------------------------ -' -' This code was generated by a tool. -' -' Changes to this file may cause incorrect behavior and will be lost if -' the code is regenerated. -' -'------------------------------------------------------------------------------ - -Option Strict On -Option Explicit On - - -Partial Public Class _Default -End Class diff --git a/AspNet4/WebForms/VB.AdvancedSearch/Default.aspx.vb b/AspNet4/WebForms/VB.AdvancedSearch/Default.aspx.vb deleted file mode 100644 index 92123234..00000000 --- a/AspNet4/WebForms/VB.AdvancedSearch/Default.aspx.vb +++ /dev/null @@ -1,10 +0,0 @@ -Imports System -Imports System.Web.UI - -Public Class _Default - Inherits Page - - Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load - - End Sub -End Class \ No newline at end of file diff --git a/AspNet4/WebForms/VB.AdvancedSearch/EasyQuery.aspx b/AspNet4/WebForms/VB.AdvancedSearch/EasyQuery.aspx deleted file mode 100644 index 3260c454..00000000 --- a/AspNet4/WebForms/VB.AdvancedSearch/EasyQuery.aspx +++ /dev/null @@ -1,166 +0,0 @@ -<%@ Page Title="EasyQuery" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="EasyQuery.aspx.vb" Inherits="EqDemo.EasyQuery" %> - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
-
-
Entities
-
- -
-
-
- -
-
-
-
Columns
-
- -
-
-
-
-
-
Conditions
-
- -
-
-
-
- -
-
-
Query Menu
-
-
- - Clear - -
- Load -
-
-
- - - - - Fetch data - -
- -

- -
-
-
-
-
-
-
SQL
-
-
-
-
-
-
- -
-
-
-
-
-
\ No newline at end of file diff --git a/AspNet4/WebForms/VB.AdvancedSearch/EasyQuery.aspx.designer.vb b/AspNet4/WebForms/VB.AdvancedSearch/EasyQuery.aspx.designer.vb deleted file mode 100644 index 8e0a7179..00000000 --- a/AspNet4/WebForms/VB.AdvancedSearch/EasyQuery.aspx.designer.vb +++ /dev/null @@ -1,16 +0,0 @@ -'------------------------------------------------------------------------------ -' -' This code was generated by a tool. -' -' Changes to this file may cause incorrect behavior and will be lost if -' the code is regenerated. -' -'------------------------------------------------------------------------------ - -Option Strict On -Option Explicit On - - - -Partial Public Class EasyQuery -End Class diff --git a/AspNet4/WebForms/VB.AdvancedSearch/EasyQuery.aspx.vb b/AspNet4/WebForms/VB.AdvancedSearch/EasyQuery.aspx.vb deleted file mode 100644 index 1ba4f7c8..00000000 --- a/AspNet4/WebForms/VB.AdvancedSearch/EasyQuery.aspx.vb +++ /dev/null @@ -1,8 +0,0 @@ -Public Class EasyQuery - Inherits System.Web.UI.Page - - Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load - - End Sub - -End Class \ No newline at end of file diff --git a/AspNet4/WebForms/VB.AdvancedSearch/EqDemo.WebFormsVB.AdvancedSearch.csproj b/AspNet4/WebForms/VB.AdvancedSearch/EqDemo.WebFormsVB.AdvancedSearch.csproj new file mode 100644 index 00000000..3b134d35 --- /dev/null +++ b/AspNet4/WebForms/VB.AdvancedSearch/EqDemo.WebFormsVB.AdvancedSearch.csproj @@ -0,0 +1,26 @@ + + + net8.0 + EqDemo + + + + + + + + + + + + + + + + + + + PreserveNewest + + + diff --git a/AspNet4/WebForms/VB.AdvancedSearch/EqDemo.WebFormsVB.AdvancedSearch.vbproj b/AspNet4/WebForms/VB.AdvancedSearch/EqDemo.WebFormsVB.AdvancedSearch.vbproj deleted file mode 100644 index eb3de0ee..00000000 --- a/AspNet4/WebForms/VB.AdvancedSearch/EqDemo.WebFormsVB.AdvancedSearch.vbproj +++ /dev/null @@ -1,329 +0,0 @@ - - - - Debug - AnyCPU - - - - - {CD8E53D2-B177-494B-AE08-1CEEF98E43D7} - {349c5851-65df-11da-9384-00065b846f21};{F184B08F-C81C-45F6-A57F-5ABD9991F28F} - Library - EqDemo - EqDemo.WebFormsVB.AdvancedSearch - v4.6.1 - Custom - true - - 44304 - - - - - - - - - true - full - true - true - bin\ - WebForms_Basic.xml - 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 - - - true - pdbonly - false - true - true - bin\ - WebForms_Basic.xml - 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 - - - - - - - - - - - - - - - - - - - - - - - - - 3.5.1 - - - 6.0.0 - - - 2.1.7 - - - 6.34.0 - - - 13.0.3 - - - 4.8.6 - - - 4.7.2 - - - 6.34.0 - - - 1.6.0 - - - 1.14.3 - - - 3.4.1 - - - 3.4.1 - - - 3.7.1 - - - 3.4.1 - - - 1.0.2 - - - 1.1.3 - - - 1.1.1 - - - 2.0.1 - - - 5.0.0 - - - 5.0.0 - - - 1.0.0 - - - 5.3.0 - - - 5.3.0 - - - 6.2.0 - - - - - - - - - - - - - - - - - - - - - - - - About.aspx - - - About.aspx - ASPXCodebehind - - - Contact.aspx - - - Contact.aspx - ASPXCodebehind - - - - ASPXCodeBehind - Default.aspx - - - Default.aspx - - - EasyQuery.aspx - - - EasyQuery.aspx - ASPXCodebehind - - - Global.asax - - - 202101141900542_IntitalCreate.vb - - - - - - True - Application.myapp - True - - - Microsoft.VisualBasic.Web.MyExtension - 1.0.0.0 - - - True - True - Resources.resx - - - True - Settings.settings - True - - - Site.Master - - - Site.Master - ASPXCodeBehind - - - ViewSwitcher.ascx - ASPXCodeBehind - - - ViewSwitcher.ascx - - - Site.Mobile.Master - ASPXCodeBehind - - - Site.Mobile.Master - - - - - 202101141900542_IntitalCreate.vb - - - VbMyResourcesResXFileCodeGenerator - Resources.Designer.vb - My.Resources - Designer - - - - - - - - MyApplicationCodeGenerator - Application.Designer.vb - - - SettingsSingleFileGenerator - My - Settings.Designer.vb - - - - - - - - - - - - - - - - - - - - - - 10.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - On - - - Binary - - - Off - - - On - - - - - - - - - - - True - True - 12967 - / - https://localhost:44304/ - False - False - - - False - - - - - - \ No newline at end of file diff --git a/AspNet4/WebForms/VB.AdvancedSearch/Global.asax b/AspNet4/WebForms/VB.AdvancedSearch/Global.asax deleted file mode 100644 index e2d202b3..00000000 --- a/AspNet4/WebForms/VB.AdvancedSearch/Global.asax +++ /dev/null @@ -1 +0,0 @@ -<%@ Application Codebehind="Global.asax.vb" Inherits="EqDemo.Global_asax" Language="vb" %> diff --git a/AspNet4/WebForms/VB.AdvancedSearch/Global.asax.vb b/AspNet4/WebForms/VB.AdvancedSearch/Global.asax.vb deleted file mode 100644 index e90ffe10..00000000 --- a/AspNet4/WebForms/VB.AdvancedSearch/Global.asax.vb +++ /dev/null @@ -1,25 +0,0 @@ -Imports System -Imports System.Configuration -Imports System.Data.Entity.Migrations -Imports System.Reflection -Imports System.Web -Imports System.Web.Http -Imports System.Web.Optimization -Imports System.Web.Routing - -Public Class Global_asax - Inherits HttpApplication - - Sub Application_Start(sender As Object, e As EventArgs) - - ' Fires when the application is started - GlobalConfiguration.Configure(AddressOf WebApiConfig.Register) - RouteConfig.RegisterRoutes(RouteTable.Routes) - BundleConfig.RegisterBundles(BundleTable.Bundles) - - Dim databaseMigrator = New DbMigrator(New EqDemo.Migrations.Configuration()) - databaseMigrator.Update() - - End Sub - -End Class \ No newline at end of file diff --git a/AspNet4/WebForms/VB.AdvancedSearch/Migrations/202101141900542_IntitalCreate.Designer.vb b/AspNet4/WebForms/VB.AdvancedSearch/Migrations/202101141900542_IntitalCreate.Designer.vb deleted file mode 100644 index e25caa9d..00000000 --- a/AspNet4/WebForms/VB.AdvancedSearch/Migrations/202101141900542_IntitalCreate.Designer.vb +++ /dev/null @@ -1,32 +0,0 @@ -' -Imports System.CodeDom.Compiler -Imports System.Data.Entity.Migrations -Imports System.Data.Entity.Migrations.Infrastructure -Imports System.Resources - -Namespace Migrations - - Public NotInheritable Partial Class InitialCreate - Implements IMigrationMetadata - - Private ReadOnly Resources As New ResourceManager(GetType(InitialCreate)) - - Private ReadOnly Property IMigrationMetadata_Id() As String Implements IMigrationMetadata.Id - Get - Return "202101141900542_IntitalCreate" - End Get - End Property - - Private ReadOnly Property IMigrationMetadata_Source() As String Implements IMigrationMetadata.Source - Get - Return Nothing - End Get - End Property - - Private ReadOnly Property IMigrationMetadata_Target() As String Implements IMigrationMetadata.Target - Get - Return Resources.GetString("Target") - End Get - End Property - End Class -End Namespace diff --git a/AspNet4/WebForms/VB.AdvancedSearch/Migrations/202101141900542_IntitalCreate.resx b/AspNet4/WebForms/VB.AdvancedSearch/Migrations/202101141900542_IntitalCreate.resx deleted file mode 100644 index a03bcdf5..00000000 --- a/AspNet4/WebForms/VB.AdvancedSearch/Migrations/202101141900542_IntitalCreate.resx +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - H4sIAAAAAAAEAO1dW2/cuBV+L9D/IMxTW2Q9tlMU22C8C8eOu0aT2PU4ad8CWqLHwuoykTiGjWJ/WR/6k/oXSurCOyWSkmYmgeEXDy/focjDc6hD8tP//vPfxc9PaRI8wqKM8+xkdnRwOAtgFuZRnK1OZht0/8OPs59/+v3vFu+i9Cn43JZ7Tcrhmll5MntAaP1mPi/DB5iC8iCNwyIv83t0EObpHET5/Pjw8K/zo6M5xBAzjBUEi5tNhuIUVj/wz7M8C+EabUDyIY9gUjbpOGdZoQYfQQrLNQjhyezd13OY5rPgNIkBlr6Eyf0sAFmWI4Bw2958KuESFXm2Wq5xAkhun9cQl7sHSQmbNr9hxW2bf3hMmj9nFVuocFOiPHUEPHrd9Mdcru7VqzPaX7jH3uGeRc/kqateO5mdAQRXefE8C2Rhb86SghRsO/WgLfoqaBL+Ce8u8iItP789OI0eAR6laAlBET68orqAVYb8vQrONgnaFPAkgxtUgORVcL25S+Lw7/D5Nv8VZifZJkn4luK24jwhASddF/kaFuj5Bt437b+MZsFcrDeXK9JqXJ36yS4z9Pp4FnzEwsFdAqkicL2wRHkB/wYzWODHj64BQrDA4/gxz6AiWZLTdhj51UrE2ocnzyz4AJ7ew2yFHk5m+N9ZcBE/wahNaVrxKYvxXMOVULHpFXYOy7CI17WaTCzrtCjAcyvlbZwBoj82UnjYxZwpY7eKVooJCxsVbYp+RyqqGcSj4x+tBlFR6x51zdM1yLajradRVMCynFzOGValy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9FldrVB6w3CjwzTu0SYHmR52yW/YgwW27y4qq59lWM8Am5mTE6HXmVvN3ES0XZfaHbxDRBk3dxsc5GxRGS7a/VMkT4qNzVNQE330eX+LcTOAYOVV9kSPEKftn0q4Xu4AuHzdXMp0gzSPxBity/OY7AqQFo2GKw+/ol1OEqffvo/VxumLAOgAAA= - - - dbo - - \ No newline at end of file diff --git a/AspNet4/WebForms/VB.AdvancedSearch/Migrations/202101141900542_IntitalCreate.vb b/AspNet4/WebForms/VB.AdvancedSearch/Migrations/202101141900542_IntitalCreate.vb deleted file mode 100644 index f0633fc2..00000000 --- a/AspNet4/WebForms/VB.AdvancedSearch/Migrations/202101141900542_IntitalCreate.vb +++ /dev/null @@ -1,184 +0,0 @@ -Imports System -Imports System.Data.Entity.Migrations -Imports Microsoft.VisualBasic - -Namespace Migrations - Public Partial Class InitialCreate - Inherits DbMigration - - Public Overrides Sub Up() - CreateTable( - "dbo.Categories", - Function(c) New With - { - .CategoryID = c.Int(nullable := False), - .CategoryName = c.String(), - .Description = c.String(), - .Array = c.Binary() - }) _ - .PrimaryKey(Function(t) t.CategoryID) - - CreateTable( - "dbo.Customers", - Function(c) New With - { - .CustomerID = c.String(nullable := False, maxLength := 128), - .CompanyName = c.String(), - .Address = c.String(), - .City = c.String(), - .Region = c.String(), - .PostalCode = c.String(), - .Country = c.String(), - .ContactName = c.String(), - .ContactTitle = c.String(), - .Phone = c.String(), - .Fax = c.String() - }) _ - .PrimaryKey(Function(t) t.CustomerID) - - CreateTable( - "dbo.Employees", - Function(c) New With - { - .EmployeeID = c.Int(nullable := False), - .LastName = c.String(nullable := False), - .FirstName = c.String(nullable := False), - .Title = c.String(maxLength := 30), - .TitleOfCourtesy = c.String(), - .BirthDate = c.DateTime(), - .HireDate = c.DateTime(), - .Address = c.String(), - .City = c.String(), - .Region = c.String(), - .PostalCode = c.String(), - .Country = c.String(), - .HomePhone = c.String(maxLength := 24), - .Extension = c.String(maxLength := 4), - .Photo = c.Binary(), - .PhotoPath = c.String(), - .Notes = c.String(), - .ReportsTo = c.Int() - }) _ - .PrimaryKey(Function(t) t.EmployeeID) _ - .ForeignKey("dbo.Employees", Function(t) t.ReportsTo) _ - .Index(Function(t) t.ReportsTo) - - CreateTable( - "dbo.Orders", - Function(c) New With - { - .OrderID = c.Int(nullable := False), - .OrderDate = c.DateTime(), - .RequiredDate = c.DateTime(), - .ShippedDate = c.DateTime(), - .Freight = c.Decimal(precision := 18, scale := 2), - .CustomerID = c.String(maxLength := 128), - .EmployeeID = c.Int(), - .ShipVia = c.Int(), - .ShipName = c.String(), - .ShipAddress = c.String(), - .ShipCity = c.String(), - .ShipRegion = c.String(), - .ShipPostalCode = c.String(), - .ShipCountry = c.String() - }) _ - .PrimaryKey(Function(t) t.OrderID) _ - .ForeignKey("dbo.Customers", Function(t) t.CustomerID) _ - .ForeignKey("dbo.Employees", Function(t) t.EmployeeID) _ - .Index(Function(t) t.CustomerID) _ - .Index(Function(t) t.EmployeeID) - - CreateTable( - "dbo.Order_Details", - Function(c) New With - { - .OrderID = c.Int(nullable := False), - .ProductID = c.Int(nullable := False), - .UnitPrice = c.Decimal(nullable := False, precision := 18, scale := 2), - .Quantity = c.Short(nullable := False), - .Discount = c.Single(nullable := False) - }) _ - .PrimaryKey(Function(t) New With { t.OrderID, t.ProductID }) _ - .ForeignKey("dbo.Orders", Function(t) t.OrderID, cascadeDelete := True) _ - .ForeignKey("dbo.Products", Function(t) t.ProductID, cascadeDelete := True) _ - .Index(Function(t) t.OrderID) _ - .Index(Function(t) t.ProductID) - - CreateTable( - "dbo.Products", - Function(c) New With - { - .ProductID = c.Int(nullable := False), - .ProductName = c.String(), - .SupplierID = c.Int(), - .CategoryID = c.Int(), - .QuantityPerUnit = c.String(), - .UnitPrice = c.Decimal(precision := 18, scale := 2), - .UnitsInStock = c.Short(), - .UnitsOnOrder = c.Short(), - .ReorderLevel = c.Short(), - .Discontinued = c.Boolean(nullable := False) - }) _ - .PrimaryKey(Function(t) t.ProductID) _ - .ForeignKey("dbo.Categories", Function(t) t.CategoryID) _ - .ForeignKey("dbo.Suppliers", Function(t) t.SupplierID) _ - .Index(Function(t) t.SupplierID) _ - .Index(Function(t) t.CategoryID) - - CreateTable( - "dbo.Suppliers", - Function(c) New With - { - .SupplierID = c.Int(nullable := False, identity := True), - .CompanyName = c.String(), - .ContactName = c.String(), - .ContactTitle = c.String(), - .Address = c.String(), - .City = c.String(), - .Region = c.String(), - .PostalCode = c.String(), - .Country = c.String(), - .Phone = c.String(), - .Fax = c.String(), - .HomePage = c.String() - }) _ - .PrimaryKey(Function(t) t.SupplierID) - - CreateTable( - "dbo.Shippers", - Function(c) New With - { - .ShipperID = c.Int(nullable := False, identity := True), - .CompanyName = c.String(), - .Phone = c.String() - }) _ - .PrimaryKey(Function(t) t.ShipperID) - - End Sub - - Public Overrides Sub Down() - DropForeignKey("dbo.Order_Details", "ProductID", "dbo.Products") - DropForeignKey("dbo.Products", "SupplierID", "dbo.Suppliers") - DropForeignKey("dbo.Products", "CategoryID", "dbo.Categories") - DropForeignKey("dbo.Order_Details", "OrderID", "dbo.Orders") - DropForeignKey("dbo.Orders", "EmployeeID", "dbo.Employees") - DropForeignKey("dbo.Orders", "CustomerID", "dbo.Customers") - DropForeignKey("dbo.Employees", "ReportsTo", "dbo.Employees") - DropIndex("dbo.Products", New String() { "CategoryID" }) - DropIndex("dbo.Products", New String() { "SupplierID" }) - DropIndex("dbo.Order_Details", New String() { "ProductID" }) - DropIndex("dbo.Order_Details", New String() { "OrderID" }) - DropIndex("dbo.Orders", New String() { "EmployeeID" }) - DropIndex("dbo.Orders", New String() { "CustomerID" }) - DropIndex("dbo.Employees", New String() { "ReportsTo" }) - DropTable("dbo.Shippers") - DropTable("dbo.Suppliers") - DropTable("dbo.Products") - DropTable("dbo.Order_Details") - DropTable("dbo.Orders") - DropTable("dbo.Employees") - DropTable("dbo.Customers") - DropTable("dbo.Categories") - End Sub - End Class -End Namespace diff --git a/AspNet4/WebForms/VB.AdvancedSearch/Migrations/Configuration.vb b/AspNet4/WebForms/VB.AdvancedSearch/Migrations/Configuration.vb deleted file mode 100644 index 8888790e..00000000 --- a/AspNet4/WebForms/VB.AdvancedSearch/Migrations/Configuration.vb +++ /dev/null @@ -1,31 +0,0 @@ -Imports System -Imports System.Data.Entity -Imports System.Data.Entity.Migrations -Imports System.Linq -Imports Korzh.DbUtils - -Namespace Migrations - - Friend NotInheritable Class Configuration - Inherits DbMigrationsConfiguration(Of ApplicationDbContext) - - Public Sub New() - AutomaticMigrationsEnabled = False - ContextKey = "EqDemo.Models.ApplicationDbContext" - End Sub - - Protected Overrides Sub Seed(context As ApplicationDbContext) - ' This method will be called after migrating to the latest version. - - ' You can use the DbSet(Of T).AddOrUpdate() helper extension method - ' to avoid creating duplicate seed data. - - DbInitializer.Create(Function(options) - options.UseSqlServer(context.Database.Connection.ConnectionString) - options.UseZipPacker(System.Web.Hosting.HostingEnvironment.MapPath("~/App_Data/EqDemoData.zip")) - End Function).Seed() - End Sub - - End Class - -End Namespace diff --git a/AspNet4/WebForms/VB.AdvancedSearch/Models/Category.cs b/AspNet4/WebForms/VB.AdvancedSearch/Models/Category.cs new file mode 100644 index 00000000..66b0d56f --- /dev/null +++ b/AspNet4/WebForms/VB.AdvancedSearch/Models/Category.cs @@ -0,0 +1,9 @@ +namespace EqDemo.Models +{ + public class Category + { + public int CategoryID { get; set; } + public string CategoryName { get; set; } + public string Description { get; set; } + } +} diff --git a/AspNet4/WebForms/VB.AdvancedSearch/Models/Customer.cs b/AspNet4/WebForms/VB.AdvancedSearch/Models/Customer.cs new file mode 100644 index 00000000..cfd2bd28 --- /dev/null +++ b/AspNet4/WebForms/VB.AdvancedSearch/Models/Customer.cs @@ -0,0 +1,38 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using Korzh.EasyQuery; + +namespace EqDemo.Models +{ + + [DisplayColumn("Name")] + [EqEntity(DisplayName = "Client")] + public class Customer + { + [Column("CustomerID")] + public string Id { get; set; } + + [Display(Name = "Company Name")] + public string CompanyName { get; set; } + + public string Address { get; set; } + + public string City { get; set; } + + public string Region { get; set; } + + public string PostalCode { get; set; } + + [EqListValueEditor] + public string Country { get; set; } + + public string ContactName { get; set; } + + public string ContactTitle { get; set; } + + public string Phone { get; set; } + + public string Fax { get; set; } + + } +} \ No newline at end of file diff --git a/AspNet4/WebForms/VB.AdvancedSearch/Models/Employee.cs b/AspNet4/WebForms/VB.AdvancedSearch/Models/Employee.cs new file mode 100644 index 00000000..cef0dfc6 --- /dev/null +++ b/AspNet4/WebForms/VB.AdvancedSearch/Models/Employee.cs @@ -0,0 +1,84 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Korzh.EasyQuery; + +namespace EqDemo.Models +{ + [DisplayColumn("FirstName")] + public class Employee + { + [DatabaseGenerated(DatabaseGeneratedOption.None)] + [Column("EmployeeID")] + public int Id { get; set; } + + [Required] + [Display(Name = "Last name")] + public string LastName { get; set; } + + [Required] + [Display(Name = "First name")] + public string FirstName { get; set; } + + [NotMapped] + public string FullName + { + get { + string res = this.FirstName; + + if (!string.IsNullOrEmpty(res)) + res += " "; + + if (!string.IsNullOrEmpty(this.LastName)) + res += this.LastName; + return res; + } + } + + + [MaxLength(30)] + public string Title { get; set; } + + public string TitleOfCourtesy { get; set; } + + [Display(Name = "Birth date")] + public DateTime? BirthDate { get; set; } + + public DateTime? HireDate { get; set; } + + public string Address { get; set; } + + public string City { get; set; } + + public string Region { get; set; } + + public string PostalCode { get; set; } + + [EqListValueEditor] + public string Country { get; set; } + + [MaxLength(24)] + public string HomePhone { get; set; } + + [MaxLength(4)] + public string Extension { get; set; } + + [ScaffoldColumn(false)] + public byte[] Photo { get; set; } + + public string PhotoPath { get; set; } + + public string Notes { get; set; } + + [ScaffoldColumn(false)] + public int? ReportsTo { get; set; } + + [ForeignKey("ReportsTo")] + public virtual Employee Manager { get; set; } + + public virtual ICollection Orders { get; set; } + + } +} \ No newline at end of file diff --git a/AspNet4/WebForms/VB.AdvancedSearch/Models/NWind/Category.vb b/AspNet4/WebForms/VB.AdvancedSearch/Models/NWind/Category.vb deleted file mode 100644 index c6a9adb1..00000000 --- a/AspNet4/WebForms/VB.AdvancedSearch/Models/NWind/Category.vb +++ /dev/null @@ -1,16 +0,0 @@ -Imports System -Imports System.ComponentModel.DataAnnotations -Imports System.ComponentModel.DataAnnotations.Schema -Public Class Category - - - - Public Property Id As Integer - Public Property CategoryName As String - Public Property Description As String - - - Public Property Array As Byte() - - -End Class diff --git a/AspNet4/WebForms/VB.AdvancedSearch/Models/NWind/Customer.vb b/AspNet4/WebForms/VB.AdvancedSearch/Models/NWind/Customer.vb deleted file mode 100644 index 2bd4f6b4..00000000 --- a/AspNet4/WebForms/VB.AdvancedSearch/Models/NWind/Customer.vb +++ /dev/null @@ -1,22 +0,0 @@ -Imports System.ComponentModel.DataAnnotations -Imports System.ComponentModel.DataAnnotations.Schema -Imports Korzh.EasyQuery - - - -Public Class Customer - - Public Property Id As String - - Public Property CompanyName As String - Public Property Address As String - Public Property City As String - Public Property Region As String - Public Property PostalCode As String - - Public Property Country As String - Public Property ContactName As String - Public Property ContactTitle As String - Public Property Phone As String - Public Property Fax As String -End Class \ No newline at end of file diff --git a/AspNet4/WebForms/VB.AdvancedSearch/Models/NWind/Employee.vb b/AspNet4/WebForms/VB.AdvancedSearch/Models/NWind/Employee.vb deleted file mode 100644 index 994d4ec9..00000000 --- a/AspNet4/WebForms/VB.AdvancedSearch/Models/NWind/Employee.vb +++ /dev/null @@ -1,56 +0,0 @@ -Imports System -Imports System.Collections.Generic -Imports System.ComponentModel.DataAnnotations -Imports System.ComponentModel.DataAnnotations.Schema -Imports Korzh.EasyQuery - - - -Public Class Employee - - - Public Property Id As Integer - - - Public Property LastName As String - - - Public Property FirstName As String - - - Public ReadOnly Property FullName As String - Get - Dim res As String = Me.FirstName - If Not String.IsNullOrEmpty(res) Then res += " " - If Not String.IsNullOrEmpty(Me.LastName) Then res += Me.LastName - Return res - End Get - End Property - - - Public Property Title As String - Public Property TitleOfCourtesy As String - - Public Property BirthDate As DateTime? - Public Property HireDate As DateTime? - Public Property Address As String - Public Property City As String - Public Property Region As String - Public Property PostalCode As String - - Public Property Country As String - - Public Property HomePhone As String - - Public Property Extension As String - - Public Property Photo As Byte() - Public Property PhotoPath As String - Public Property Notes As String - - Public Property ReportsTo As Integer? - - Public Overridable Property Manager As Employee - Public Overridable Property Orders As ICollection(Of Order) -End Class - diff --git a/AspNet4/WebForms/VB.AdvancedSearch/Models/NWind/Order.vb b/AspNet4/WebForms/VB.AdvancedSearch/Models/NWind/Order.vb deleted file mode 100644 index 4f8e4f7c..00000000 --- a/AspNet4/WebForms/VB.AdvancedSearch/Models/NWind/Order.vb +++ /dev/null @@ -1,43 +0,0 @@ -Imports System -Imports System.Collections.Generic -Imports System.ComponentModel.DataAnnotations -Imports System.ComponentModel.DataAnnotations.Schema - - - -Public Class Order - - - Public Property Id As Integer - - - Public ReadOnly Property Name As String - Get - Return String.Format("{0:0000}-{1:yyyy-MM-dd}", Me.Id, Me.OrderDate) - End Get - End Property - - - Public Property OrderDate As DateTime? - - Public Property RequiredDate As DateTime? - - Public Property ShippedDate As DateTime? - Public Property Freight As Decimal? - Public Property CustomerID As String - - Public Overridable Property Customer As Customer - Public Property EmployeeID As Integer? - - Public Overridable Property Employee As Employee - Public Overridable Property Items As List(Of OrderDetail) - - Public Property ShipVia As Integer? - Public Property ShipName As String - Public Property ShipAddress As String - Public Property ShipCity As String - Public Property ShipRegion As String - Public Property ShipPostalCode As String - Public Property ShipCountry As String -End Class - diff --git a/AspNet4/WebForms/VB.AdvancedSearch/Models/NWind/OrderDetail.vb b/AspNet4/WebForms/VB.AdvancedSearch/Models/NWind/OrderDetail.vb deleted file mode 100644 index 0dfcdf38..00000000 --- a/AspNet4/WebForms/VB.AdvancedSearch/Models/NWind/OrderDetail.vb +++ /dev/null @@ -1,9 +0,0 @@ -Public Class OrderDetail - Public Property OrderID As Integer - Public Overridable Property Order As Order - Public Property ProductID As Integer - Public Overridable Property Product As Product - Public Property UnitPrice As Decimal - Public Property Quantity As Short - Public Property Discount As Single -End Class diff --git a/AspNet4/WebForms/VB.AdvancedSearch/Models/NWind/Product.vb b/AspNet4/WebForms/VB.AdvancedSearch/Models/NWind/Product.vb deleted file mode 100644 index cecbc2c2..00000000 --- a/AspNet4/WebForms/VB.AdvancedSearch/Models/NWind/Product.vb +++ /dev/null @@ -1,24 +0,0 @@ -Imports System.ComponentModel.DataAnnotations -Imports System.ComponentModel.DataAnnotations.Schema - - -Public Class Product - - - Public Property Id As Integer - - Public Property Name As String - - Public Property SupplierID As Integer? - - Public Overridable Property Supplier As Supplier - Public Property CategoryID As Integer? - - Public Overridable Property Category As Category - Public Property QuantityPerUnit As String - Public Property UnitPrice As Decimal? - Public Property UnitsInStock As Short? - Public Property UnitsOnOrder As Short? - Public Property ReorderLevel As Short? - Public Property Discontinued As Boolean -End Class \ No newline at end of file diff --git a/AspNet4/WebForms/VB.AdvancedSearch/Models/NWind/Shipper.vb b/AspNet4/WebForms/VB.AdvancedSearch/Models/NWind/Shipper.vb deleted file mode 100644 index 937ad283..00000000 --- a/AspNet4/WebForms/VB.AdvancedSearch/Models/NWind/Shipper.vb +++ /dev/null @@ -1,8 +0,0 @@ -Imports System.ComponentModel.DataAnnotations.Schema - -Public Class Shipper - - Public Property Id As Integer - Public Property CompanyName As String - Public Property Phone As String -End Class diff --git a/AspNet4/WebForms/VB.AdvancedSearch/Models/NWind/Supplier.vb b/AspNet4/WebForms/VB.AdvancedSearch/Models/NWind/Supplier.vb deleted file mode 100644 index 77ab65b6..00000000 --- a/AspNet4/WebForms/VB.AdvancedSearch/Models/NWind/Supplier.vb +++ /dev/null @@ -1,18 +0,0 @@ -Imports System.ComponentModel.DataAnnotations.Schema - -Public Class Supplier - - Public Property Id As Integer - Public Property CompanyName As String - Public Property ContactName As String - Public Property ContactTitle As String - Public Property Address As String - Public Property City As String - Public Property Region As String - Public Property PostalCode As String - Public Property Country As String - Public Property Phone As String - Public Property Fax As String - Public Property HomePage As String -End Class - diff --git a/AspNet4/WebForms/VB.AdvancedSearch/Models/Order.cs b/AspNet4/WebForms/VB.AdvancedSearch/Models/Order.cs new file mode 100644 index 00000000..a73b1f8d --- /dev/null +++ b/AspNet4/WebForms/VB.AdvancedSearch/Models/Order.cs @@ -0,0 +1,63 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Korzh.EasyQuery; + +namespace EqDemo.Models +{ + [DisplayColumn("Name")] + public class Order + { + [DatabaseGenerated(DatabaseGeneratedOption.None)] + [Column("OrderID")] + public int Id { get; set; } + + [NotMapped] + public string Name + { + get { + return string.Format("{0:0000}-{1:yyyy-MM-dd}", this.Id, this.OrderDate); + } + } + + [Display(Name = "Ordered")] + public DateTime? OrderDate { get; set; } + + [Display(Name = "Required")] + public DateTime? RequiredDate { get; set; } + + [Display(Name = "Shipped")] + public DateTime? ShippedDate { get; set; } + + public decimal? Freight { get; set; } + + public string CustomerID { get; set; } + + [ForeignKey("CustomerID")] + public virtual Customer Customer { get; set; } + + public int? EmployeeID { get; set; } + + [ForeignKey("EmployeeID")] + public virtual Employee Employee { get; set; } + + public virtual List Items { get; set; } + + [ScaffoldColumn(false)] + public int? ShipVia { get; set; } + + public string ShipName { get; set; } + + public string ShipAddress { get; set; } + + public string ShipCity { get; set; } + + public string ShipRegion { get; set; } + + public string ShipPostalCode { get; set; } + + public string ShipCountry { get; set; } + } +} \ No newline at end of file diff --git a/AspNet4/WebForms/VB.AdvancedSearch/Models/OrderDetail.cs b/AspNet4/WebForms/VB.AdvancedSearch/Models/OrderDetail.cs new file mode 100644 index 00000000..dc353ec1 --- /dev/null +++ b/AspNet4/WebForms/VB.AdvancedSearch/Models/OrderDetail.cs @@ -0,0 +1,18 @@ +namespace EqDemo.Models +{ + + public class OrderDetail + { + public int OrderID { get; set; } + public virtual Order Order { get; set; } + + public int ProductID { get; set; } + public virtual Product Product { get; set; } + + public decimal UnitPrice { get; set; } + + public short Quantity { get; set; } + + public float Discount { get; set; } + } +} \ No newline at end of file diff --git a/AspNet4/WebForms/VB.AdvancedSearch/Models/Product.cs b/AspNet4/WebForms/VB.AdvancedSearch/Models/Product.cs new file mode 100644 index 00000000..e5176f3d --- /dev/null +++ b/AspNet4/WebForms/VB.AdvancedSearch/Models/Product.cs @@ -0,0 +1,42 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Korzh.EasyQuery; + +namespace EqDemo.Models +{ + [DisplayColumn("Name")] + public class Product + { + [DatabaseGenerated(DatabaseGeneratedOption.None)] + [Column("ProductID")] + public int Id { get; set; } + + [Column("ProductName")] + public string Name { get; set; } + + [ScaffoldColumn(false)] + public int? SupplierID { get; set; } + + + [ForeignKey("SupplierID")] + public virtual Supplier Supplier { get; set; } + + public int? CategoryID { get; set; } + + [ForeignKey("CategoryID")] + public virtual Category Category { get; set; } + + public string QuantityPerUnit { get; set; } + + public decimal? UnitPrice { get; set; } + + public short? UnitsInStock { get; set; } + + public short? UnitsOnOrder { get; set; } + + public short? ReorderLevel { get; set; } + + public bool Discontinued { get; set; } + } +} \ No newline at end of file diff --git a/AspNet4/WebForms/VB.AdvancedSearch/Models/Shipper.cs b/AspNet4/WebForms/VB.AdvancedSearch/Models/Shipper.cs new file mode 100644 index 00000000..74bd8138 --- /dev/null +++ b/AspNet4/WebForms/VB.AdvancedSearch/Models/Shipper.cs @@ -0,0 +1,14 @@ +using System.ComponentModel.DataAnnotations.Schema; + +namespace EqDemo.Models +{ + public class Shipper + { + [Column("ShipperID")] + public int Id { get; set; } + + public string CompanyName { get; set; } + + public string Phone { get; set; } + } +} \ No newline at end of file diff --git a/AspNet4/WebForms/VB.AdvancedSearch/Models/Supplier.cs b/AspNet4/WebForms/VB.AdvancedSearch/Models/Supplier.cs new file mode 100644 index 00000000..92d646a1 --- /dev/null +++ b/AspNet4/WebForms/VB.AdvancedSearch/Models/Supplier.cs @@ -0,0 +1,33 @@ +using System.ComponentModel.DataAnnotations.Schema; + +namespace EqDemo.Models +{ + public class Supplier + { + + [Column("SupplierID")] + public int Id { get; set; } + + public string CompanyName { get; set; } + + public string ContactName { get; set; } + + public string ContactTitle { get; set; } + + public string Address { get; set; } + + public string City { get; set; } + + public string Region { get; set; } + + public string PostalCode { get; set; } + + public string Country { get; set; } + + public string Phone { get; set; } + + public string Fax { get; set; } + + public string HomePage { get; set; } + } +} \ No newline at end of file diff --git a/AspNet4/WebForms/VB.AdvancedSearch/My Project/Application.Designer.vb b/AspNet4/WebForms/VB.AdvancedSearch/My Project/Application.Designer.vb deleted file mode 100644 index 88dd01c7..00000000 --- a/AspNet4/WebForms/VB.AdvancedSearch/My Project/Application.Designer.vb +++ /dev/null @@ -1,13 +0,0 @@ -'------------------------------------------------------------------------------ -' -' This code was generated by a tool. -' Runtime Version:4.0.30319.42000 -' -' Changes to this file may cause incorrect behavior and will be lost if -' the code is regenerated. -' -'------------------------------------------------------------------------------ - -Option Strict On -Option Explicit On - diff --git a/AspNet4/WebForms/VB.AdvancedSearch/My Project/Application.myapp b/AspNet4/WebForms/VB.AdvancedSearch/My Project/Application.myapp deleted file mode 100644 index 758895de..00000000 --- a/AspNet4/WebForms/VB.AdvancedSearch/My Project/Application.myapp +++ /dev/null @@ -1,10 +0,0 @@ - - - false - false - 0 - true - 0 - 1 - true - diff --git a/AspNet4/WebForms/VB.AdvancedSearch/My Project/AssemblyInfo.vb b/AspNet4/WebForms/VB.AdvancedSearch/My Project/AssemblyInfo.vb deleted file mode 100644 index 4ffff065..00000000 --- a/AspNet4/WebForms/VB.AdvancedSearch/My Project/AssemblyInfo.vb +++ /dev/null @@ -1,34 +0,0 @@ -Imports System -Imports System.Reflection -Imports System.Runtime.InteropServices - -' General Information about an assembly is controlled through the following -' set of attributes. Change these attribute values to modify the information -' associated with an assembly. - -' Review the values of the assembly attributes - - - - - - - - - -'The following GUID is for the ID of the typelib if this project is exposed to COM - - -' Version information for an assembly consists of the following four values: -' -' Major Version -' Minor Version -' Build Number -' Revision -' -' You can specify all the values or you can default the Build and Revision Numbers -' by using the '*' as shown below: -' - - - diff --git a/AspNet4/WebForms/VB.AdvancedSearch/My Project/MyExtensions/MyWebExtension.vb b/AspNet4/WebForms/VB.AdvancedSearch/My Project/MyExtensions/MyWebExtension.vb deleted file mode 100644 index 1f6b4e2c..00000000 --- a/AspNet4/WebForms/VB.AdvancedSearch/My Project/MyExtensions/MyWebExtension.vb +++ /dev/null @@ -1,73 +0,0 @@ -#If _MyType <> "Empty" Then - -Namespace My - ''' - ''' Module used to define the properties that are available in the My Namespace for Web projects. - ''' - ''' - _ - Module MyWebExtension - Private ReadOnly s_Computer As New ThreadSafeObjectProvider(Of Global.Microsoft.VisualBasic.Devices.ServerComputer) - Private ReadOnly s_User As New ThreadSafeObjectProvider(Of Global.Microsoft.VisualBasic.ApplicationServices.WebUser) - Private ReadOnly s_Log As New ThreadSafeObjectProvider(Of Global.Microsoft.VisualBasic.Logging.AspLog) - ''' - ''' Returns information about the host computer. - ''' - _ - Friend ReadOnly Property Computer() As Global.Microsoft.VisualBasic.Devices.ServerComputer - Get - Return s_Computer.GetInstance() - End Get - End Property - ''' - ''' Returns information for the current Web user. - ''' - _ - Friend ReadOnly Property User() As Global.Microsoft.VisualBasic.ApplicationServices.WebUser - Get - Return s_User.GetInstance() - End Get - End Property - ''' - ''' Returns Request object. - ''' - _ - _ - Friend ReadOnly Property Request() As Global.System.Web.HttpRequest - _ - Get - Dim CurrentContext As Global.System.Web.HttpContext = Global.System.Web.HttpContext.Current - If CurrentContext IsNot Nothing Then - Return CurrentContext.Request - End If - Return Nothing - End Get - End Property - ''' - ''' Returns Response object. - ''' - _ - _ - Friend ReadOnly Property Response() As Global.System.Web.HttpResponse - _ - Get - Dim CurrentContext As Global.System.Web.HttpContext = Global.System.Web.HttpContext.Current - If CurrentContext IsNot Nothing Then - Return CurrentContext.Response - End If - Return Nothing - End Get - End Property - ''' - ''' Returns the Asp log object. - ''' - _ - Friend ReadOnly Property Log() As Global.Microsoft.VisualBasic.Logging.AspLog - Get - Return s_Log.GetInstance() - End Get - End Property - End Module -End Namespace - -#End If \ No newline at end of file diff --git a/AspNet4/WebForms/VB.AdvancedSearch/My Project/Resources.Designer.vb b/AspNet4/WebForms/VB.AdvancedSearch/My Project/Resources.Designer.vb deleted file mode 100644 index b0c8576e..00000000 --- a/AspNet4/WebForms/VB.AdvancedSearch/My Project/Resources.Designer.vb +++ /dev/null @@ -1,63 +0,0 @@ -'------------------------------------------------------------------------------ -' -' This code was generated by a tool. -' Runtime Version:4.0.30319.42000 -' -' Changes to this file may cause incorrect behavior and will be lost if -' the code is regenerated. -' -'------------------------------------------------------------------------------ - -Option Strict On -Option Explicit On - -Imports System - -Namespace My.Resources - - 'This class was auto-generated by the StronglyTypedResourceBuilder - 'class via a tool like ResGen or Visual Studio. - 'To add or remove a member, edit your .ResX file then rerun ResGen - 'with the /str option, or rebuild your VS project. - ''' - ''' A strongly-typed resource class, for looking up localized strings, etc. - ''' - _ - Friend Module Resources - - Private resourceMan As Global.System.Resources.ResourceManager - - Private resourceCulture As Global.System.Globalization.CultureInfo - - ''' - ''' Returns the cached ResourceManager instance used by this class. - ''' - _ - Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager - Get - If Object.ReferenceEquals(resourceMan, Nothing) Then - Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("EqDemo.Resources", GetType(Resources).Assembly) - resourceMan = temp - End If - Return resourceMan - End Get - End Property - - ''' - ''' Overrides the current thread's CurrentUICulture property for all - ''' resource lookups using this strongly typed resource class. - ''' - _ - Friend Property Culture() As Global.System.Globalization.CultureInfo - Get - Return resourceCulture - End Get - Set - resourceCulture = value - End Set - End Property - End Module -End Namespace diff --git a/AspNet4/WebForms/VB.AdvancedSearch/My Project/Resources.resx b/AspNet4/WebForms/VB.AdvancedSearch/My Project/Resources.resx deleted file mode 100644 index 5931345e..00000000 --- a/AspNet4/WebForms/VB.AdvancedSearch/My Project/Resources.resx +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/AspNet4/WebForms/VB.AdvancedSearch/My Project/Settings.Designer.vb b/AspNet4/WebForms/VB.AdvancedSearch/My Project/Settings.Designer.vb deleted file mode 100644 index fe6fffa5..00000000 --- a/AspNet4/WebForms/VB.AdvancedSearch/My Project/Settings.Designer.vb +++ /dev/null @@ -1,73 +0,0 @@ -'------------------------------------------------------------------------------ -' -' This code was generated by a tool. -' Runtime Version:4.0.30319.42000 -' -' Changes to this file may cause incorrect behavior and will be lost if -' the code is regenerated. -' -'------------------------------------------------------------------------------ - -Option Strict On -Option Explicit On - - -Namespace My - - _ - Partial Friend NotInheritable Class MySettings - Inherits Global.System.Configuration.ApplicationSettingsBase - - Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings) - -#Region "My.Settings Auto-Save Functionality" -#If _MyType = "WindowsForms" Then - Private Shared addedHandler As Boolean - - Private Shared addedHandlerLockObject As New Object - - _ - Private Shared Sub AutoSaveSettings(sender As Global.System.Object, e As Global.System.EventArgs) - If My.Application.SaveMySettingsOnExit Then - My.Settings.Save() - End If - End Sub -#End If -#End Region - - Public Shared ReadOnly Property [Default]() As MySettings - Get - -#If _MyType = "WindowsForms" Then - If Not addedHandler Then - SyncLock addedHandlerLockObject - If Not addedHandler Then - AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings - addedHandler = True - End If - End SyncLock - End If -#End If - Return defaultInstance - End Get - End Property - End Class -End Namespace - -Namespace My - - _ - Friend Module MySettingsProperty - - _ - Friend ReadOnly Property Settings() As Global.EqDemo.My.MySettings - Get - Return Global.EqDemo.My.MySettings.Default - End Get - End Property - End Module -End Namespace diff --git a/AspNet4/WebForms/VB.AdvancedSearch/My Project/Settings.settings b/AspNet4/WebForms/VB.AdvancedSearch/My Project/Settings.settings deleted file mode 100644 index 85b890b3..00000000 --- a/AspNet4/WebForms/VB.AdvancedSearch/My Project/Settings.settings +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/AspNet4/WebForms/VB.AdvancedSearch/NWindSQL.xml b/AspNet4/WebForms/VB.AdvancedSearch/NWindSQL.xml deleted file mode 100644 index f7843282..00000000 --- a/AspNet4/WebForms/VB.AdvancedSearch/NWindSQL.xml +++ /dev/null @@ -1,444 +0,0 @@ - - - - - - - -
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - String,Byte,Word,Int32,Int64,Bool,Float,Currency,BCD,Autoinc,Memo,FixedChar - - - - String,Byte,Word,Int32,Int64,Bool,Float,Currency,BCD,Autoinc,Memo,FixedChar - - - - String,Byte,Word,Int32,Int64,Bool,Float,Currency,BCD,Autoinc,Memo,FixedChar - - - - String,Byte,Word,Int32,Int64,Bool,Float,Currency,BCD,Autoinc,Memo,FixedChar - - - - String,Byte,Word,Int32,Int64,Bool,Float,Currency,BCD,Autoinc,Memo,FixedChar - - - - String,Byte,Word,Int32,Int64,Bool,Float,Currency,BCD,Autoinc,Memo,FixedChar - - - - String,Byte,Word,Int32,Int64,Bool,Float,Currency,BCD,Autoinc,Memo,FixedChar - - - - String,Byte,Word,Int32,Int64,Bool,Float,Currency,BCD,Autoinc,Memo,FixedChar - - - - Bool,Float - - - - Bool,Float - - - - String,Byte,Word,Int32,Int64,Bool,Float,Currency,BCD,Autoinc,Memo,FixedChar - - - - String,Byte,Word,Int32,Int64,Bool,Float,Currency,BCD,Autoinc,Memo,FixedChar - - - - String,Byte,Word,Int32,Int64,Bool,Float,Currency,BCD,Autoinc,Memo,FixedChar - - - - String,Byte,Word,Int32,Int64,Bool,Float,Currency,BCD,Autoinc,Memo,FixedChar - - - - String,Memo,FixedChar,Float - - - - String,Memo,FixedChar,Float - - - - String,Memo,FixedChar,Float - - - - String,Memo,FixedChar,Float - - - - String,Byte,Word,Int32,Int64,Bool,Float,Currency,BCD,Autoinc,Memo,FixedChar - - - - String,Byte,Word,Int32,Int64,Bool,Float,Currency,BCD,Autoinc,Memo,FixedChar - - - - Date,Time,DateTime,Float - - - - Date,Time,DateTime,Float - - - - Date,Time,DateTime,Float - - - - Date,Time,DateTime,Float - - - - Date,Time,DateTime,Float - - - - Date,Time,DateTime,Float - - - - Date,Time,DateTime,Float - - - - Date,Time,DateTime,Float - - - - Date,Time,DateTime,Float - - - - Date,Time,DateTime,Float - - - - - - - Date,Time,DateTime,Float - - - - Date,Time,DateTime,Float - - - - Date,Time,DateTime,Float - - - - - - - String,Byte,Word,Int32,Int64,Bool,Float,Currency,BCD,Autoinc,Memo,FixedChar - - - - Byte,Word,Int,Int32,Int64,Float - - - - String,Byte,Word,Int32,Int64,Bool,Float,Currency,BCD,Autoinc,Memo,FixedChar - - - - - - - StartsWith,Contains,Equal,InList,NotStartsWith,NotContains,NotEqual,NotInList,InSubQuery,NotInSubQuery - - - - StartsWith,Contains,Equal,InList,NotStartsWith,NotContains,NotEqual,NotInList,InSubQuery,NotInSubQuery,IsNull,IsNotNull - - - - StartsWith,Contains,Equal,InList,NotStartsWith,NotContains,NotEqual,NotInList,InSubQuery,NotInSubQuery,IsNull,IsNotNull - - - - StartsWith,Contains,Equal,InList,NotStartsWith,NotContains,NotEqual,NotInList,InSubQuery,NotInSubQuery,IsNull,IsNotNull - - - - StartsWith,Contains,Equal,InList,NotStartsWith,NotContains,NotEqual,NotInList,InSubQuery,NotInSubQuery,IsNull,IsNotNull - - - - Equal,InList,NotEqual,NotInList,IsNull - - - - StartsWith,Contains,Equal,InList,NotStartsWith,NotContains,NotEqual,NotInList,InSubQuery,NotInSubQuery,IsNull,IsNotNull - - - - StartsWith,Contains,Equal,InList,NotStartsWith,NotContains,NotEqual,NotInList,InSubQuery,NotInSubQuery,IsNull,IsNotNull - - - - StartsWith,Contains,Equal,InList,NotStartsWith,NotContains,NotEqual,NotInList,InSubQuery,NotInSubQuery,IsNull,IsNotNull - - - - StartsWith,Contains,Equal,InList,NotStartsWith,NotContains,NotEqual,NotInList,InSubQuery,NotInSubQuery,IsNull,IsNotNull - - - - StartsWith,Contains,Equal,InList,NotStartsWith,NotContains,NotEqual,NotInList,InSubQuery,NotInSubQuery,IsNull,IsNotNull - - - - - - Equal,Between,LessThan,LessOrEqual,GreaterThan,GreaterOrEqual,InList,NotEqual,NotBetween,NotInList,MaximumOfAttr,InSubQuery,NotInSubQuery - - - - DateWithinToday,DateWithinThisWeek,DateWithinPrevWeek,DateWithinThisMonth,DateWithinPrevMonth,DateWithinThisYear,DateWithinPrevYear,DateBeforePrecise,DateAfterPrecise,DatePeriodPrecise,MaximumOfAttr,IsNull,IsNotNull - - - - StartsWith,Contains,Equal,InList,NotStartsWith,NotContains,NotEqual,NotInList,InSubQuery,NotInSubQuery,IsNull,IsNotNull - - - - Equal,InList,NotEqual,NotInList,IsNull - - - - StartsWith,Contains,Equal,InList,NotStartsWith,NotContains,NotEqual,NotInList,InSubQuery,NotInSubQuery,IsNull,IsNotNull - - - - StartsWith,Contains,Equal,InList,NotStartsWith,NotContains,NotEqual,NotInList,InSubQuery,NotInSubQuery - - - - DateWithinToday,DateWithinThisWeek,DateWithinPrevWeek,DateWithinThisMonth,DateWithinPrevMonth,DateWithinThisYear,DateWithinPrevYear,DateBeforePrecise,DateAfterPrecise,DatePeriodPrecise,MaximumOfAttr,IsNull,IsNotNull - - - - StartsWith,Contains,Equal,InList,NotStartsWith,NotContains,NotEqual,NotInList,InSubQuery,NotInSubQuery,IsNull,IsNotNull - - - - StartsWith,Contains,Equal,InList,NotStartsWith,NotContains,NotEqual,NotInList,InSubQuery,NotInSubQuery - - - - Equal,NotEqual,InList,NotInList,IsNull,IsNotNull - - - - StartsWith,Contains,Equal,InList,NotStartsWith,NotContains,NotEqual,NotInList,InSubQuery,NotInSubQuery,IsNull,IsNotNull - - - - Equal,Between,LessThan,LessOrEqual,GreaterThan,GreaterOrEqual,InList,NotEqual,NotBetween,NotInList,MaximumOfAttr,InSubQuery,NotInSubQuery,IsNull,IsNotNull - - - - StartsWith,Contains,Equal,InList,NotStartsWith,NotContains,NotEqual,NotInList,InSubQuery,NotInSubQuery,IsNull,IsNotNull - - - - StartsWith,Contains,Equal,InList,NotStartsWith,NotContains,NotEqual,NotInList,InSubQuery,NotInSubQuery,IsNull,IsNotNull - - - - Equal,Between,LessThan,LessOrEqual,GreaterThan,GreaterOrEqual,InList,NotEqual,NotBetween,NotInList,MaximumOfAttr,InSubQuery,NotInSubQuery,IsNull,IsNotNull - - - - StartsWith,Contains,Equal,InList,NotStartsWith,NotContains,NotEqual,NotInList,InSubQuery,NotInSubQuery,IsNull,IsNotNull - - - - StartsWith,Contains,Equal,InList,NotStartsWith,NotContains,NotEqual,NotInList,InSubQuery,NotInSubQuery,IsNull,IsNotNull - - - - - - Equal,Between,LessThan,LessOrEqual,GreaterThan,GreaterOrEqual,InList,NotEqual,NotBetween,NotInList,MaximumOfAttr,InSubQuery,NotInSubQuery - - - - Equal,NotEqual,InList,NotInList,IsNull,IsNotNull - - - - Equal,NotEqual,InList,NotInList - - - - Equal,Between,LessThan,LessOrEqual,GreaterThan,GreaterOrEqual,InList,NotEqual,NotBetween,NotInList,MaximumOfAttr,InSubQuery,NotInSubQuery,IsNull,IsNotNull - - - - DateWithinToday,DateWithinThisWeek,DateWithinPrevWeek,DateWithinThisMonth,DateWithinPrevMonth,DateWithinThisYear,DateWithinPrevYear,DateBeforePrecise,DateAfterPrecise,DatePeriodPrecise,MaximumOfAttr,IsNull,IsNotNull - - - - DateWithinToday,DateWithinThisWeek,DateWithinPrevWeek,DateWithinThisMonth,DateWithinPrevMonth,DateWithinThisYear,DateWithinPrevYear,DateBeforePrecise,DateAfterPrecise,DatePeriodPrecise,MaximumOfAttr,IsNull,IsNotNull - - - - StartsWith,Contains,Equal,InList,NotStartsWith,NotContains,NotEqual,NotInList,InSubQuery,NotInSubQuery,IsNull,IsNotNull - - - - StartsWith,Contains,Equal,InList,NotStartsWith,NotContains,NotEqual,NotInList,InSubQuery,NotInSubQuery,IsNull,IsNotNull - - - - StartsWith,Contains,Equal,InList,NotStartsWith,NotContains,NotEqual,NotInList,InSubQuery,NotInSubQuery,IsNull,IsNotNull - - - - StartsWith,Contains,Equal,InList,NotStartsWith,NotContains,NotEqual,NotInList,InSubQuery,NotInSubQuery,IsNull,IsNotNull - - - - StartsWith,Contains,Equal,InList,NotStartsWith,NotContains,NotEqual,NotInList,InSubQuery,NotInSubQuery,IsNull,IsNotNull - - - - StartsWith,Contains,Equal,InList,NotStartsWith,NotContains,NotEqual,NotInList,InSubQuery,NotInSubQuery,IsNull,IsNotNull - - - - Equal,Between,LessThan,LessOrEqual,GreaterThan,GreaterOrEqual,InList,NotEqual,NotBetween,NotInList,MaximumOfAttr,InSubQuery,NotInSubQuery,IsNull,IsNotNull - - - - DateWithinToday,DateWithinThisWeek,DateWithinPrevWeek,DateWithinThisMonth,DateWithinPrevMonth,DateWithinThisYear,DateWithinPrevYear,DateBeforePrecise,DateAfterPrecise,DatePeriodPrecise,MaximumOfAttr,IsNull,IsNotNull - - - - - - Equal,NotEqual,InList,NotInList - - - - Equal,NotEqual,InList,NotInList - - - - Equal,Between,LessThan,LessOrEqual,GreaterThan,GreaterOrEqual,InList,NotEqual,NotBetween,NotInList,MaximumOfAttr,InSubQuery,NotInSubQuery - - - - Equal,Between,LessThan,LessOrEqual,GreaterThan,GreaterOrEqual,InList,NotEqual,NotBetween,NotInList,MaximumOfAttr,InSubQuery,NotInSubQuery - - - - Equal,Between,LessThan,LessOrEqual,GreaterThan,GreaterOrEqual,InList,NotEqual,NotBetween,NotInList,MaximumOfAttr,InSubQuery,NotInSubQuery - - - - - - Equal,Between,LessThan,LessOrEqual,GreaterThan,GreaterOrEqual,InList,NotEqual,NotBetween,NotInList,MaximumOfAttr,InSubQuery,NotInSubQuery - - - - IsTrue,NotTrue - - - - StartsWith,Contains,Equal,InList,NotStartsWith,NotContains,NotEqual,NotInList,InSubQuery,NotInSubQuery,IsNull,IsNotNull - - - - StartsWith,Contains,Equal,InList,NotStartsWith,NotContains,NotEqual,NotInList,InSubQuery,NotInSubQuery,IsNull,IsNotNull - - - - Equal,Between,LessThan,LessOrEqual,GreaterThan,GreaterOrEqual,InList,NotEqual,NotBetween,NotInList,MaximumOfAttr,InSubQuery,NotInSubQuery,IsNull,IsNotNull - - - - Equal,Between,LessThan,LessOrEqual,GreaterThan,GreaterOrEqual,InList,NotEqual,NotBetween,NotInList,MaximumOfAttr,InSubQuery,NotInSubQuery,IsNull,IsNotNull - - - - Equal,Between,LessThan,LessOrEqual,GreaterThan,GreaterOrEqual,InList,NotEqual,NotBetween,NotInList,MaximumOfAttr,InSubQuery,NotInSubQuery,IsNull,IsNotNull - - - - Equal,Between,LessThan,LessOrEqual,GreaterThan,GreaterOrEqual,InList,NotEqual,NotBetween,NotInList,MaximumOfAttr,InSubQuery,NotInSubQuery,IsNull,IsNotNull - - - - Equal,Between,LessThan,LessOrEqual,GreaterThan,GreaterOrEqual,InList,NotEqual,NotBetween,NotInList,MaximumOfAttr,InSubQuery,NotInSubQuery,IsNull,IsNotNull - - - - - \ No newline at end of file diff --git a/AspNet4/WebForms/VB.AdvancedSearch/Program.cs b/AspNet4/WebForms/VB.AdvancedSearch/Program.cs new file mode 100644 index 00000000..83414752 --- /dev/null +++ b/AspNet4/WebForms/VB.AdvancedSearch/Program.cs @@ -0,0 +1,20 @@ +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Hosting; + +namespace EqDemo +{ + public class Program + { + public static void Main(string[] args) + { + CreateHostBuilder(args).Build().Run(); + } + + public static IHostBuilder CreateHostBuilder(string[] args) => + Host.CreateDefaultBuilder(args) + .ConfigureWebHostDefaults(webBuilder => + { + webBuilder.UseStartup(); + }); + } +} diff --git a/AspNet4/WebForms/VB.AdvancedSearch/Services/CustomEasyQueryManager.vb b/AspNet4/WebForms/VB.AdvancedSearch/Services/CustomEasyQueryManager.vb deleted file mode 100644 index 71bb9fb5..00000000 --- a/AspNet4/WebForms/VB.AdvancedSearch/Services/CustomEasyQueryManager.vb +++ /dev/null @@ -1,22 +0,0 @@ -Imports System -Imports System.Data - -Imports Newtonsoft.Json.Linq - -Imports Korzh.EasyQuery.Services - -Public Class CustomEasyQueryManager : Inherits EasyQueryManagerSql - Public Sub New(services As IServiceProvider, options As EasyQueryOptions) - MyBase.New(services, options) - End Sub - - Public Overrides Function GetDataReader(Optional options As JObject = Nothing, Optional addPaging As Boolean = False) As IDataReader - - For Each tuner In PreExecuteTuners - tuner.Tune(Me) - Next - - Return MyBase.GetDataReader(options, addPaging) - End Function - -End Class diff --git a/AspNet4/WebForms/VB.AdvancedSearch/Site.Master b/AspNet4/WebForms/VB.AdvancedSearch/Site.Master deleted file mode 100644 index 1a750a20..00000000 --- a/AspNet4/WebForms/VB.AdvancedSearch/Site.Master +++ /dev/null @@ -1,89 +0,0 @@ -<%@ Master Language="VB" AutoEventWireup="true" CodeBehind="Site.master.vb" Inherits="EqDemo.SiteMaster" %> - - - - - - - - <%: Page.Title %> - EasyQuery Demo Application - - - - - - - - - - - - - -
- <%-- - - - - - - - - - - - - - - - - - - --%> - -
- - -
-
-

© <%: DateTime.Now.Year %> - EasyQuery Demo Application

-
-
- - - - - - - - - - diff --git a/AspNet4/WebForms/VB.AdvancedSearch/Site.Master.designer.vb b/AspNet4/WebForms/VB.AdvancedSearch/Site.Master.designer.vb deleted file mode 100644 index ef0bce16..00000000 --- a/AspNet4/WebForms/VB.AdvancedSearch/Site.Master.designer.vb +++ /dev/null @@ -1,42 +0,0 @@ -'------------------------------------------------------------------------------ -' -' This code was generated by a tool. -' -' Changes to this file may cause incorrect behavior and will be lost if -' the code is regenerated. -' -'------------------------------------------------------------------------------ - -Option Strict On -Option Explicit On - - -Partial Public Class SiteMaster - - ''' - '''StylesPlaceHolder control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents StylesPlaceHolder As Global.System.Web.UI.WebControls.ContentPlaceHolder - - ''' - '''MainContent control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents MainContent As Global.System.Web.UI.WebControls.ContentPlaceHolder - - ''' - '''ScriptsPlaceHolder control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents ScriptsPlaceHolder As Global.System.Web.UI.WebControls.ContentPlaceHolder -End Class diff --git a/AspNet4/WebForms/VB.AdvancedSearch/Site.Master.vb b/AspNet4/WebForms/VB.AdvancedSearch/Site.Master.vb deleted file mode 100644 index 66db1952..00000000 --- a/AspNet4/WebForms/VB.AdvancedSearch/Site.Master.vb +++ /dev/null @@ -1,9 +0,0 @@ -Imports System -Imports System.Web.UI - -Public Class SiteMaster - Inherits MasterPage - Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load - - End Sub -End Class \ No newline at end of file diff --git a/AspNet4/WebForms/VB.AdvancedSearch/Site.Mobile.Master b/AspNet4/WebForms/VB.AdvancedSearch/Site.Mobile.Master deleted file mode 100644 index 9f0298c9..00000000 --- a/AspNet4/WebForms/VB.AdvancedSearch/Site.Mobile.Master +++ /dev/null @@ -1,25 +0,0 @@ -<%@ Master Language="VB" AutoEventWireup="false" CodeBehind="Site.Mobile.master.vb" Inherits="EqDemo.Site_Mobile" %> - -<%@ Register Src="~/ViewSwitcher.ascx" TagPrefix="friendlyUrls" TagName="ViewSwitcher" %> - - - - - - - - - -
-
-

Mobile Master Page

- -
- -
- -
- - - - diff --git a/AspNet4/WebForms/VB.AdvancedSearch/Site.Mobile.Master.designer.vb b/AspNet4/WebForms/VB.AdvancedSearch/Site.Mobile.Master.designer.vb deleted file mode 100644 index 1bc10a51..00000000 --- a/AspNet4/WebForms/VB.AdvancedSearch/Site.Mobile.Master.designer.vb +++ /dev/null @@ -1,69 +0,0 @@ -'------------------------------------------------------------------------------ -' -' This code was generated by a tool. -' -' Changes to this file may cause incorrect behavior and will be lost if -' the code is regenerated. -' -'------------------------------------------------------------------------------ - -Option Strict On -Option Explicit On - - -Partial Public Class Site_Mobile - - ''' - '''Head1 control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents Head1 As Global.System.Web.UI.HtmlControls.HtmlHead - - ''' - '''HeadContent control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents HeadContent As Global.System.Web.UI.WebControls.ContentPlaceHolder - - ''' - '''form1 control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents form1 As Global.System.Web.UI.HtmlControls.HtmlForm - - ''' - '''FeaturedContent control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents FeaturedContent As Global.System.Web.UI.WebControls.ContentPlaceHolder - - ''' - '''MainContent control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents MainContent As Global.System.Web.UI.WebControls.ContentPlaceHolder - - ''' - '''ViewSwitcher1 control. - ''' - ''' - '''Auto-generated field. - '''To modify move field declaration from designer file to code-behind file. - ''' - Protected WithEvents ViewSwitcher1 As Global.System.Web.UI.UserControl -End Class diff --git a/AspNet4/WebForms/VB.AdvancedSearch/Site.Mobile.Master.vb b/AspNet4/WebForms/VB.AdvancedSearch/Site.Mobile.Master.vb deleted file mode 100644 index cde0823a..00000000 --- a/AspNet4/WebForms/VB.AdvancedSearch/Site.Mobile.Master.vb +++ /dev/null @@ -1,8 +0,0 @@ -Public Class Site_Mobile - Inherits System.Web.UI.MasterPage - - Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load - - End Sub - -End Class \ No newline at end of file diff --git a/AspNet4/WebForms/VB.AdvancedSearch/Startup.cs b/AspNet4/WebForms/VB.AdvancedSearch/Startup.cs new file mode 100644 index 00000000..34487de4 --- /dev/null +++ b/AspNet4/WebForms/VB.AdvancedSearch/Startup.cs @@ -0,0 +1,72 @@ +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; + +using Korzh.EasyQuery.Services; +using Korzh.EasyQuery.Db; + +using EqDemo.Models; + +namespace EqDemo +{ + public class Startup + { + public Startup(IConfiguration configuration) + { + Configuration = configuration; + DbConnectionString = Configuration.GetConnectionString("DefaultConnection"); + } + + public IConfiguration Configuration { get; } + public string DbConnectionString { get; } + + public void ConfigureServices(IServiceCollection services) + { + services.AddDbContext( + options => options.UseSqlServer(DbConnectionString) + ); + + services.AddDistributedMemoryCache(); + services.AddSession(); + + services.AddEasyQuery() + .UseSqlManager() + .AddDefaultExporters() + .RegisterDbGate(); + + services.AddRazorPages(); + } + + public void Configure(IApplicationBuilder app, IWebHostEnvironment env) + { + if (env.IsDevelopment()) { + app.UseDeveloperExceptionPage(); + } + else { + app.UseExceptionHandler("/Error"); + app.UseHsts(); + } + + app.UseHttpsRedirection(); + app.UseStaticFiles(); + app.UseRouting(); + app.UseSession(); + + app.UseEndpoints(endpoints => { + endpoints.MapEasyQuery(options => { + options.DefaultModelId = "nwind"; + options.BuildQueryOnSync = true; + options.SaveNewQuery = false; + options.ConnectionString = DbConnectionString; + options.UseDbContext(); + options.UseQueryStore((_) => new FileQueryStore("App_Data")); + }); + + endpoints.MapRazorPages(); + }); + } + } +} diff --git a/AspNet4/WebForms/VB.AdvancedSearch/ViewSwitcher.ascx b/AspNet4/WebForms/VB.AdvancedSearch/ViewSwitcher.ascx deleted file mode 100644 index 7e269b5a..00000000 --- a/AspNet4/WebForms/VB.AdvancedSearch/ViewSwitcher.ascx +++ /dev/null @@ -1,4 +0,0 @@ -<%@ Control Language="vb" AutoEventWireup="false" CodeBehind="ViewSwitcher.ascx.vb" Inherits="EqDemo.ViewSwitcher" %> -
- <%: CurrentView %> view | Switch to <%: AlternateView %> -
diff --git a/AspNet4/WebForms/VB.AdvancedSearch/ViewSwitcher.ascx.designer.vb b/AspNet4/WebForms/VB.AdvancedSearch/ViewSwitcher.ascx.designer.vb deleted file mode 100644 index 29b31626..00000000 --- a/AspNet4/WebForms/VB.AdvancedSearch/ViewSwitcher.ascx.designer.vb +++ /dev/null @@ -1,16 +0,0 @@ -'------------------------------------------------------------------------------ -' -' This code was generated by a tool. -' -' Changes to this file may cause incorrect behavior and will be lost if -' the code is regenerated. -' -'------------------------------------------------------------------------------ - -Option Strict On -Option Explicit On - - - -Partial Public Class ViewSwitcher -End Class diff --git a/AspNet4/WebForms/VB.AdvancedSearch/ViewSwitcher.ascx.vb b/AspNet4/WebForms/VB.AdvancedSearch/ViewSwitcher.ascx.vb deleted file mode 100644 index e8c914bb..00000000 --- a/AspNet4/WebForms/VB.AdvancedSearch/ViewSwitcher.ascx.vb +++ /dev/null @@ -1,55 +0,0 @@ -Imports System -Imports System.Web -Imports Microsoft.AspNet.FriendlyUrls.Resolvers - -Public Class ViewSwitcher - Inherits System.Web.UI.UserControl - - Protected Property CurrentView() As String - Get - Return m_CurrentView - End Get - Private Set(value As String) - m_CurrentView = value - End Set - End Property - Private m_CurrentView As String - - Protected Property AlternateView() As String - Get - Return m_AlternateView - End Get - Private Set(value As String) - m_AlternateView = value - End Set - End Property - Private m_AlternateView As String - - Protected Property SwitchUrl() As String - Get - Return m_SwitchUrl - End Get - Private Set(value As String) - m_SwitchUrl = value - End Set - End Property - Private m_SwitchUrl As String - - Protected Sub Page_Load(sender As Object, e As EventArgs) - ' Determine current view - Dim isMobile = WebFormsFriendlyUrlResolver.IsMobileView(New HttpContextWrapper(Context)) - CurrentView = If(isMobile, "Mobile", "Desktop") - - ' Determine alternate view - AlternateView = If(isMobile, "Desktop", "Mobile") - - ' Create switch URL from the route, e.g. ~/__FriendlyUrls_SwitchView/Mobile?ReturnUrl=/Page - Dim url = GetRouteUrl("AspNet.FriendlyUrls.SwitchView", New With { _ - Key .view = AlternateView _ - }) - url += "?ReturnUrl=" & HttpUtility.UrlEncode(Request.RawUrl) - SwitchUrl = url - End Sub - - -End Class \ No newline at end of file diff --git a/AspNet4/WebForms/VB.AdvancedSearch/Web.Debug.config b/AspNet4/WebForms/VB.AdvancedSearch/Web.Debug.config deleted file mode 100644 index fae9cfef..00000000 --- a/AspNet4/WebForms/VB.AdvancedSearch/Web.Debug.config +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/AspNet4/WebForms/VB.AdvancedSearch/Web.Release.config b/AspNet4/WebForms/VB.AdvancedSearch/Web.Release.config deleted file mode 100644 index da6e960b..00000000 --- a/AspNet4/WebForms/VB.AdvancedSearch/Web.Release.config +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/AspNet4/WebForms/VB.AdvancedSearch/Web.config b/AspNet4/WebForms/VB.AdvancedSearch/Web.config deleted file mode 100644 index f2324fb2..00000000 --- a/AspNet4/WebForms/VB.AdvancedSearch/Web.config +++ /dev/null @@ -1,307 +0,0 @@ - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/AspNet4/WebForms/VB.AdvancedSearch/appsettings.json b/AspNet4/WebForms/VB.AdvancedSearch/appsettings.json new file mode 100644 index 00000000..88feee9e --- /dev/null +++ b/AspNet4/WebForms/VB.AdvancedSearch/appsettings.json @@ -0,0 +1,14 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Warning" + } + }, + "AllowedHosts": "*", + "ConnectionStrings": { + "DefaultConnection": "Data Source=(localdb)\\MSSQLLocalDB;Initial Catalog=EqDemo.WebFormsVB.AdvancedSearch;Integrated Security=True;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False" + }, + "EasyQuery": { + "LicenseKey": "" + } +} diff --git a/WinForms/EqDemoWinFormsNet4/App.config b/WinForms/EqDemoWinFormsNet4/App.config index 4e07360a..a28c3e63 100644 --- a/WinForms/EqDemoWinFormsNet4/App.config +++ b/WinForms/EqDemoWinFormsNet4/App.config @@ -1,23 +1,10 @@ - - -
- - - - - + - - - - - - - - - + + + diff --git a/WinForms/EqDemoWinFormsNet4/Data/ApplicationDbContext.cs b/WinForms/EqDemoWinFormsNet4/Data/ApplicationDbContext.cs index af7f2dd5..0e9adde2 100644 --- a/WinForms/EqDemoWinFormsNet4/Data/ApplicationDbContext.cs +++ b/WinForms/EqDemoWinFormsNet4/Data/ApplicationDbContext.cs @@ -1,11 +1,13 @@ -using System.Data.Entity; +using System.Configuration; + +using Microsoft.EntityFrameworkCore; namespace EqDemo.Models { public class ApplicationDbContext : DbContext { public ApplicationDbContext() - : base("DefaultConnection") + : base() { } @@ -31,7 +33,13 @@ public ApplicationDbContext() #endregion - protected override void OnModelCreating(DbModelBuilder modelBuilder) + protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) + { + var connectionString = ConfigurationManager.ConnectionStrings["DefaultConnection"]?.ToString(); + optionsBuilder.UseSqlServer(connectionString); + } + + protected override void OnModelCreating(ModelBuilder modelBuilder) { base.OnModelCreating(modelBuilder); @@ -47,4 +55,4 @@ public static ApplicationDbContext Create() } -} \ No newline at end of file +} diff --git a/WinForms/EqDemoWinFormsNet4/EasyQueryForm/EasyQueryForm.cs b/WinForms/EqDemoWinFormsNet4/EasyQueryForm/EasyQueryForm.cs index 3bfdbda2..a2a9cc71 100644 --- a/WinForms/EqDemoWinFormsNet4/EasyQueryForm/EasyQueryForm.cs +++ b/WinForms/EqDemoWinFormsNet4/EasyQueryForm/EasyQueryForm.cs @@ -1,8 +1,7 @@ -using System; +using System; using System.Diagnostics; using System.Configuration; using System.Data; -using System.Data.Entity.Migrations; using System.IO; using System.Windows.Forms; @@ -12,7 +11,7 @@ using Korzh.EasyQuery; using Korzh.EasyQuery.Db; -using Korzh.EasyQuery.EntityFramework; +using Korzh.EasyQuery.EntityFrameworkCore.Relational; using Korzh.EasyQuery.Services; using Korzh.EasyQuery.WinForms; @@ -132,8 +131,9 @@ private void CheckConnection() var connectionString = ConfigurationManager.ConnectionStrings["DefaultConnection"]?.ToString(); _connection = new SqlConnection(connectionString); - var migrator = new DbMigrator(new EqDemo.Migrations.Configuration()); - migrator.Update(); + using (var dbContext = ApplicationDbContext.Create()) { + dbContext.Database.EnsureCreated(); + } } catch (Exception ex) { MessageBox.Show(ex.Message); diff --git a/WinForms/EqDemoWinFormsNet4/EqDemoWinFormsNet4.csproj b/WinForms/EqDemoWinFormsNet4/EqDemoWinFormsNet4.csproj index cf82ad28..79c703e6 100644 --- a/WinForms/EqDemoWinFormsNet4/EqDemoWinFormsNet4.csproj +++ b/WinForms/EqDemoWinFormsNet4/EqDemoWinFormsNet4.csproj @@ -1,151 +1,80 @@ - - - - - Debug - AnyCPU - {5622F0C6-C856-4122-A303-D527B9FC0518} - WinExe - EqDemo - EqDemoWinFormsNet4 - v4.7.2 - 512 - true - true - - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - Form - - - EasyQueryForm.cs - - - - Form - - - MainForm.cs - - - - 202101141900542_IntitalCreate.cs - - - - - - - - - - - - - - - EasyQueryForm.cs - - - MainForm.cs - - - 202101141900542_IntitalCreate.cs - - - ResXFileCodeGenerator - Resources.Designer.cs - Designer - - - True - Resources.resx - True - - - - - - Always - - - - Always - - - Always - - - Always - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - True - Settings.settings - True - - - - - - - - - - - - - - - - 1.5.8 - - - - 2.1.7 - - - 4.8.6 - - - - - - - - - - - - - - - - - - \ No newline at end of file + + + WinExe + net8.0-windows + true + EqDemo + + + + + + + Always + + + Always + + + Always + + + Always + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + + + + + + + + + + + + + + + + + + + + + + MainForm.cs + + + EasyQueryForm.cs + + + True + Resources.resx + True + + + True + Settings.settings + True + + + + + + EasyQueryForm.cs + + + MainForm.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + diff --git a/WinForms/EqDemoWinFormsNet4/Migrations/202101141900542_IntitalCreate.Designer.cs b/WinForms/EqDemoWinFormsNet4/Migrations/202101141900542_IntitalCreate.Designer.cs deleted file mode 100644 index 937c5cbf..00000000 --- a/WinForms/EqDemoWinFormsNet4/Migrations/202101141900542_IntitalCreate.Designer.cs +++ /dev/null @@ -1,29 +0,0 @@ -// -namespace EqDemo.Migrations -{ - using System.CodeDom.Compiler; - using System.Data.Entity.Migrations; - using System.Data.Entity.Migrations.Infrastructure; - using System.Resources; - - [GeneratedCode("EntityFramework.Migrations", "6.2.0-61023")] - public sealed partial class IntitalCreate : IMigrationMetadata - { - private readonly ResourceManager Resources = new ResourceManager(typeof(IntitalCreate)); - - string IMigrationMetadata.Id - { - get { return "202101141900542_IntitalCreate"; } - } - - string IMigrationMetadata.Source - { - get { return null; } - } - - string IMigrationMetadata.Target - { - get { return Resources.GetString("Target"); } - } - } -} diff --git a/WinForms/EqDemoWinFormsNet4/Migrations/202101141900542_IntitalCreate.cs b/WinForms/EqDemoWinFormsNet4/Migrations/202101141900542_IntitalCreate.cs deleted file mode 100644 index 54dedd7d..00000000 --- a/WinForms/EqDemoWinFormsNet4/Migrations/202101141900542_IntitalCreate.cs +++ /dev/null @@ -1,185 +0,0 @@ -namespace EqDemo.Migrations -{ - using System; - using System.Data.Entity.Migrations; - - public partial class IntitalCreate : DbMigration - { - public override void Up() - { - CreateTable( - "dbo.Categories", - c => new - { - CategoryID = c.Int(nullable: false), - CategoryName = c.String(), - Description = c.String(), - Picture = c.Binary(), - }) - .PrimaryKey(t => t.CategoryID); - - CreateTable( - "dbo.Customers", - c => new - { - CustomerID = c.String(nullable: false, maxLength: 128), - CompanyName = c.String(), - Address = c.String(), - City = c.String(), - Region = c.String(), - PostalCode = c.String(), - Country = c.String(), - ContactName = c.String(), - ContactTitle = c.String(), - Phone = c.String(), - Fax = c.String(), - }) - .PrimaryKey(t => t.CustomerID); - - CreateTable( - "dbo.Employees", - c => new - { - EmployeeID = c.Int(nullable: false), - LastName = c.String(nullable: false), - FirstName = c.String(nullable: false), - Title = c.String(maxLength: 30), - TitleOfCourtesy = c.String(), - BirthDate = c.DateTime(), - HireDate = c.DateTime(), - Address = c.String(), - City = c.String(), - Region = c.String(), - PostalCode = c.String(), - Country = c.String(), - HomePhone = c.String(maxLength: 24), - Extension = c.String(maxLength: 4), - Photo = c.Binary(), - PhotoPath = c.String(), - Notes = c.String(), - ReportsTo = c.Int(), - }) - .PrimaryKey(t => t.EmployeeID) - .ForeignKey("dbo.Employees", t => t.ReportsTo) - .Index(t => t.ReportsTo); - - CreateTable( - "dbo.Orders", - c => new - { - OrderID = c.Int(nullable: false), - OrderDate = c.DateTime(), - RequiredDate = c.DateTime(), - ShippedDate = c.DateTime(), - Freight = c.Decimal(precision: 18, scale: 2), - CustomerID = c.String(maxLength: 128), - EmployeeID = c.Int(), - ShipVia = c.Int(), - ShipName = c.String(), - ShipAddress = c.String(), - ShipCity = c.String(), - ShipRegion = c.String(), - ShipPostalCode = c.String(), - ShipCountry = c.String(), - }) - .PrimaryKey(t => t.OrderID) - .ForeignKey("dbo.Customers", t => t.CustomerID) - .ForeignKey("dbo.Employees", t => t.EmployeeID) - .Index(t => t.CustomerID) - .Index(t => t.EmployeeID); - - CreateTable( - "dbo.Order_Details", - c => new - { - OrderID = c.Int(nullable: false), - ProductID = c.Int(nullable: false), - UnitPrice = c.Decimal(nullable: false, precision: 18, scale: 2), - Quantity = c.Short(nullable: false), - Discount = c.Single(nullable: false), - }) - .PrimaryKey(t => new { t.OrderID, t.ProductID }) - .ForeignKey("dbo.Orders", t => t.OrderID, cascadeDelete: true) - .ForeignKey("dbo.Products", t => t.ProductID, cascadeDelete: true) - .Index(t => t.OrderID) - .Index(t => t.ProductID); - - CreateTable( - "dbo.Products", - c => new - { - ProductID = c.Int(nullable: false), - ProductName = c.String(), - SupplierID = c.Int(), - CategoryID = c.Int(), - QuantityPerUnit = c.String(), - UnitPrice = c.Decimal(precision: 18, scale: 2), - UnitsInStock = c.Short(), - UnitsOnOrder = c.Short(), - ReorderLevel = c.Short(), - Discontinued = c.Boolean(nullable: false), - }) - .PrimaryKey(t => t.ProductID) - .ForeignKey("dbo.Categories", t => t.CategoryID) - .ForeignKey("dbo.Suppliers", t => t.SupplierID) - .Index(t => t.SupplierID) - .Index(t => t.CategoryID); - - CreateTable( - "dbo.Suppliers", - c => new - { - SupplierID = c.Int(nullable: false, identity: true), - CompanyName = c.String(), - ContactName = c.String(), - ContactTitle = c.String(), - Address = c.String(), - City = c.String(), - Region = c.String(), - PostalCode = c.String(), - Country = c.String(), - Phone = c.String(), - Fax = c.String(), - HomePage = c.String(), - }) - .PrimaryKey(t => t.SupplierID); - - CreateTable( - "dbo.Shippers", - c => new - { - ShipperID = c.Int(nullable: false, identity: true), - CompanyName = c.String(), - Phone = c.String(), - }) - .PrimaryKey(t => t.ShipperID); - - } - - public override void Down() - { - DropForeignKey("dbo.Order_Details", "ProductID", "dbo.Products"); - DropForeignKey("dbo.Products", "SupplierID", "dbo.Suppliers"); - DropForeignKey("dbo.Products", "CategoryID", "dbo.Categories"); - DropForeignKey("dbo.Order_Details", "OrderID", "dbo.Orders"); - DropForeignKey("dbo.Orders", "EmployeeID", "dbo.Employees"); - DropForeignKey("dbo.Orders", "CustomerID", "dbo.Customers"); - DropForeignKey("dbo.Employees", "ReportsTo", "dbo.Employees"); - DropIndex("dbo.Products", new[] { "CategoryID" }); - DropIndex("dbo.Products", new[] { "SupplierID" }); - DropIndex("dbo.Order_Details", new[] { "ProductID" }); - DropIndex("dbo.Order_Details", new[] { "OrderID" }); - DropIndex("dbo.Orders", new[] { "EmployeeID" }); - DropIndex("dbo.Orders", new[] { "CustomerID" }); - DropIndex("dbo.Employees", new[] { "ReportsTo" }); - DropTable("dbo.Shippers"); - DropTable("dbo.Suppliers"); - DropTable("dbo.Products"); - DropTable("dbo.Order_Details"); - DropTable("dbo.Orders"); - DropTable("dbo.Employees"); - DropTable("dbo.Customers"); - DropTable("dbo.Categories"); - } - } -} diff --git a/WinForms/EqDemoWinFormsNet4/Migrations/202101141900542_IntitalCreate.resx b/WinForms/EqDemoWinFormsNet4/Migrations/202101141900542_IntitalCreate.resx deleted file mode 100644 index f0c0df5c..00000000 --- a/WinForms/EqDemoWinFormsNet4/Migrations/202101141900542_IntitalCreate.resx +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - H4sIAAAAAAAEAO1d3W7juBW+L9B3EHzVFrNxklkU28DZRSaZdINOfhpnBr0LGIlxhJUlj0QHCYp9sl70kfoKJfXDf0okJdmeQZCbmBS/Q5GH5xwdUp/+95//zn55WSbB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1uCzyVuqsX//EAlKDOxMflvdrI/UbYjhlBj5aMykkfhBjKhffWSwtaXkF32dV20gLTu0iuAneHu3hIe7DZ+d+GFbCf/2+NiXjD1MBaohl/Bkh/ssW+1L4+5IrfE50wY7Xi/YcL0a9CxORHJuvnQ8w0OC6H25wUQZt88xK5S8TAjNSLZ050oezdph60vHTgkv4YTQ++KYpfh+n77nyKy6QaU+mj+pVWqRti6VU50uSZ1NLvvraS71bnto8n0QM5bVE9UrfwFyoy6DOPKoNWaWUYaUNlESysVkSwKp0IMzenLKKO3BT8ulwHbiC61CI3a0eP39QapdwbmAdNrMBtpMA6ITcmNkIZnzkmRQCr0kkw80AqIhrWYFVCU6MVQHmIJfxNsg1riWE19sKUCrJovV1GYXmxi8R0bTcqLDCOZ2So2xuEMth/Hke+vcE5gbu7ag4MDBwH/W9VeXjqx/grez+RhbPtdiUzKrxJP9xtDsTnK9tk8ZXe7d3mKHS9Dl0eUYEdqHjV9+lwVLhOyVHH6tcZLOIFg5hhzBSGQjxIr7lIH7MmMpV61Fwi7aBc4luLcLB4kqP4EYQIV4ewKMrPT34Bybo0eg8wukiv12i1RviW4fIhEZYHCW/b5Jd8w2KfZ9fli1/FELeAuxmT06HX6Yd1nES03+eaXXwDBImb620uMpeIbHctXinSlfKupgmoHj4a7t9B7BwwWHGdzsEz9Onb5wJ+ggsQvt7Ur0WaQbonQhz22VkMFjlYFjUGa49/Yh2Oli8//x+XuC2CcqAAAA== - - - dbo - - \ No newline at end of file diff --git a/WinForms/EqDemoWinFormsNet4/Migrations/Configuration.cs b/WinForms/EqDemoWinFormsNet4/Migrations/Configuration.cs deleted file mode 100644 index 1ffcb732..00000000 --- a/WinForms/EqDemoWinFormsNet4/Migrations/Configuration.cs +++ /dev/null @@ -1,32 +0,0 @@ -namespace EqDemo.Migrations -{ - using Korzh.DbUtils; - using System; - using System.Data.Entity; - using System.Data.Entity.Migrations; - using System.Linq; - using System.IO; - - internal sealed class Configuration : DbMigrationsConfiguration - { - public Configuration() - { - AutomaticMigrationsEnabled = false; - ContextKey = "EqDemo.Models.ApplicationDbContext"; - } - - protected override void Seed(EqDemo.Models.ApplicationDbContext context) - { - // This method will be called after migrating to the latest version. - - // You can use the DbSet.AddOrUpdate() helper extension method - // to avoid creating duplicate seed data. - - Korzh.DbUtils.DbInitializer.Create(options => { - options.UseSqlServer(context.Database.Connection.ConnectionString); - options.UseZipPacker(Path.Combine(Directory.GetCurrentDirectory(), "App_Data/EqDemoData.zip")); - }) - .Seed(); - } - } -} diff --git a/WinForms/EqDemoWinFormsNet4/Properties/AssemblyInfo.cs b/WinForms/EqDemoWinFormsNet4/Properties/AssemblyInfo.cs deleted file mode 100644 index 79570e1e..00000000 --- a/WinForms/EqDemoWinFormsNet4/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("EqWinFormsDemo")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("EqWinFormsDemo")] -[assembly: AssemblyCopyright("Copyright © 2019")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("5622f0c6-c856-4122-a303-d527b9fc0518")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/WinForms/EqDemoWinFormsNet6/EqDemoWinFormsNet6.csproj b/WinForms/EqDemoWinFormsNet6/EqDemoWinFormsNet6.csproj index 1a3e03d9..4fac30eb 100644 --- a/WinForms/EqDemoWinFormsNet6/EqDemoWinFormsNet6.csproj +++ b/WinForms/EqDemoWinFormsNet6/EqDemoWinFormsNet6.csproj @@ -1,7 +1,7 @@ WinExe - net6.0-windows + net8.0-windows true EqDemo @@ -63,4 +63,4 @@ MainForm.cs - \ No newline at end of file + diff --git a/Wpf/EqDemoWpfNet4/App.config b/Wpf/EqDemoWpfNet4/App.config index a8864b4e..32d016dd 100644 --- a/Wpf/EqDemoWpfNet4/App.config +++ b/Wpf/EqDemoWpfNet4/App.config @@ -1,19 +1,6 @@ - - -
- - - - - + - - - - - - diff --git a/Wpf/EqDemoWpfNet4/Data/ApplicationDbContext.cs b/Wpf/EqDemoWpfNet4/Data/ApplicationDbContext.cs index af7f2dd5..0e9adde2 100644 --- a/Wpf/EqDemoWpfNet4/Data/ApplicationDbContext.cs +++ b/Wpf/EqDemoWpfNet4/Data/ApplicationDbContext.cs @@ -1,11 +1,13 @@ -using System.Data.Entity; +using System.Configuration; + +using Microsoft.EntityFrameworkCore; namespace EqDemo.Models { public class ApplicationDbContext : DbContext { public ApplicationDbContext() - : base("DefaultConnection") + : base() { } @@ -31,7 +33,13 @@ public ApplicationDbContext() #endregion - protected override void OnModelCreating(DbModelBuilder modelBuilder) + protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) + { + var connectionString = ConfigurationManager.ConnectionStrings["DefaultConnection"]?.ToString(); + optionsBuilder.UseSqlServer(connectionString); + } + + protected override void OnModelCreating(ModelBuilder modelBuilder) { base.OnModelCreating(modelBuilder); @@ -47,4 +55,4 @@ public static ApplicationDbContext Create() } -} \ No newline at end of file +} diff --git a/Wpf/EqDemoWpfNet4/EasyQueryPage.xaml.cs b/Wpf/EqDemoWpfNet4/EasyQueryPage.xaml.cs index d38b844d..801ca850 100644 --- a/Wpf/EqDemoWpfNet4/EasyQueryPage.xaml.cs +++ b/Wpf/EqDemoWpfNet4/EasyQueryPage.xaml.cs @@ -1,7 +1,6 @@ using System; using System.Diagnostics; using System.Data; -using System.Data.Entity.Migrations; using System.IO; using System.Configuration; using System.Windows; @@ -16,7 +15,7 @@ using Korzh.EasyQuery.Wpf; using Korzh.EasyQuery.Db; using Korzh.EasyQuery.Services; -using Korzh.EasyQuery.EntityFramework; +using Korzh.EasyQuery.EntityFrameworkCore.Relational; using EqDemo.Models; @@ -48,8 +47,9 @@ private void InitDatabase() var connectionString = ConfigurationManager.ConnectionStrings["DefaultConnection"]?.ToString(); _connection = new SqlConnection(connectionString); - var migrator = new DbMigrator(new EqDemo.Migrations.Configuration()); - migrator.Update(); + using (var dbContext = ApplicationDbContext.Create()) { + dbContext.Database.EnsureCreated(); + } } EasyQueryManagerSql EqManager { get; set; } diff --git a/Wpf/EqDemoWpfNet4/EqDemoWpfNet4.csproj b/Wpf/EqDemoWpfNet4/EqDemoWpfNet4.csproj index 70e5b989..833b7620 100644 --- a/Wpf/EqDemoWpfNet4/EqDemoWpfNet4.csproj +++ b/Wpf/EqDemoWpfNet4/EqDemoWpfNet4.csproj @@ -1,190 +1,82 @@ - - - - - Debug - AnyCPU - {A1ACB19F-E36C-43B8-9BC6-BA79DF916366} - WinExe - EqDemo - EqDemoWpfNet4 - v4.7.2 - 512 - {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 4 - true - true - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - 2.1.7 - - - - - - - - - - - - - - - - - - - MSBuild:Compile - Designer - - - App.xaml - Code - - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - - - EasyQueryPage.xaml - - - MainPage.xaml - - - MainWindow.xaml - - - - 202101141900542_IntitalCreate.cs - - - - - - - - - - - - PostalCodeDialog.xaml - - - Code - - - True - True - Resources.resx - - - True - Settings.settings - True - - - 202101141900542_IntitalCreate.cs - - - ResXFileCodeGenerator - Resources.Designer.cs - - - Always - - - Always - - - Always - - - Always - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - - - - - - False - Microsoft .NET Framework 4.6.1 %28x86 and x64%29 - true - - - False - .NET Framework 3.5 SP1 - false - - - - \ No newline at end of file + + + WinExe + net8.0-windows + true + EqDemo + + + + Designer + MSBuild:Compile + + + + + Always + + + Always + + + Always + + + Always + + + + + + + + + + + + + + + + + + + + + + + Code + App.xaml + + + Code + MainWindow.xaml + + + PostalCodeDialog.xaml + + + EasyQueryPage.xaml + + + MainPage.xaml + + + + + Designer + MSBuild:Compile + + + Designer + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + diff --git a/Wpf/EqDemoWpfNet4/Migrations/202101141900542_IntitalCreate.Designer.cs b/Wpf/EqDemoWpfNet4/Migrations/202101141900542_IntitalCreate.Designer.cs deleted file mode 100644 index 937c5cbf..00000000 --- a/Wpf/EqDemoWpfNet4/Migrations/202101141900542_IntitalCreate.Designer.cs +++ /dev/null @@ -1,29 +0,0 @@ -// -namespace EqDemo.Migrations -{ - using System.CodeDom.Compiler; - using System.Data.Entity.Migrations; - using System.Data.Entity.Migrations.Infrastructure; - using System.Resources; - - [GeneratedCode("EntityFramework.Migrations", "6.2.0-61023")] - public sealed partial class IntitalCreate : IMigrationMetadata - { - private readonly ResourceManager Resources = new ResourceManager(typeof(IntitalCreate)); - - string IMigrationMetadata.Id - { - get { return "202101141900542_IntitalCreate"; } - } - - string IMigrationMetadata.Source - { - get { return null; } - } - - string IMigrationMetadata.Target - { - get { return Resources.GetString("Target"); } - } - } -} diff --git a/Wpf/EqDemoWpfNet4/Migrations/202101141900542_IntitalCreate.cs b/Wpf/EqDemoWpfNet4/Migrations/202101141900542_IntitalCreate.cs deleted file mode 100644 index 54dedd7d..00000000 --- a/Wpf/EqDemoWpfNet4/Migrations/202101141900542_IntitalCreate.cs +++ /dev/null @@ -1,185 +0,0 @@ -namespace EqDemo.Migrations -{ - using System; - using System.Data.Entity.Migrations; - - public partial class IntitalCreate : DbMigration - { - public override void Up() - { - CreateTable( - "dbo.Categories", - c => new - { - CategoryID = c.Int(nullable: false), - CategoryName = c.String(), - Description = c.String(), - Picture = c.Binary(), - }) - .PrimaryKey(t => t.CategoryID); - - CreateTable( - "dbo.Customers", - c => new - { - CustomerID = c.String(nullable: false, maxLength: 128), - CompanyName = c.String(), - Address = c.String(), - City = c.String(), - Region = c.String(), - PostalCode = c.String(), - Country = c.String(), - ContactName = c.String(), - ContactTitle = c.String(), - Phone = c.String(), - Fax = c.String(), - }) - .PrimaryKey(t => t.CustomerID); - - CreateTable( - "dbo.Employees", - c => new - { - EmployeeID = c.Int(nullable: false), - LastName = c.String(nullable: false), - FirstName = c.String(nullable: false), - Title = c.String(maxLength: 30), - TitleOfCourtesy = c.String(), - BirthDate = c.DateTime(), - HireDate = c.DateTime(), - Address = c.String(), - City = c.String(), - Region = c.String(), - PostalCode = c.String(), - Country = c.String(), - HomePhone = c.String(maxLength: 24), - Extension = c.String(maxLength: 4), - Photo = c.Binary(), - PhotoPath = c.String(), - Notes = c.String(), - ReportsTo = c.Int(), - }) - .PrimaryKey(t => t.EmployeeID) - .ForeignKey("dbo.Employees", t => t.ReportsTo) - .Index(t => t.ReportsTo); - - CreateTable( - "dbo.Orders", - c => new - { - OrderID = c.Int(nullable: false), - OrderDate = c.DateTime(), - RequiredDate = c.DateTime(), - ShippedDate = c.DateTime(), - Freight = c.Decimal(precision: 18, scale: 2), - CustomerID = c.String(maxLength: 128), - EmployeeID = c.Int(), - ShipVia = c.Int(), - ShipName = c.String(), - ShipAddress = c.String(), - ShipCity = c.String(), - ShipRegion = c.String(), - ShipPostalCode = c.String(), - ShipCountry = c.String(), - }) - .PrimaryKey(t => t.OrderID) - .ForeignKey("dbo.Customers", t => t.CustomerID) - .ForeignKey("dbo.Employees", t => t.EmployeeID) - .Index(t => t.CustomerID) - .Index(t => t.EmployeeID); - - CreateTable( - "dbo.Order_Details", - c => new - { - OrderID = c.Int(nullable: false), - ProductID = c.Int(nullable: false), - UnitPrice = c.Decimal(nullable: false, precision: 18, scale: 2), - Quantity = c.Short(nullable: false), - Discount = c.Single(nullable: false), - }) - .PrimaryKey(t => new { t.OrderID, t.ProductID }) - .ForeignKey("dbo.Orders", t => t.OrderID, cascadeDelete: true) - .ForeignKey("dbo.Products", t => t.ProductID, cascadeDelete: true) - .Index(t => t.OrderID) - .Index(t => t.ProductID); - - CreateTable( - "dbo.Products", - c => new - { - ProductID = c.Int(nullable: false), - ProductName = c.String(), - SupplierID = c.Int(), - CategoryID = c.Int(), - QuantityPerUnit = c.String(), - UnitPrice = c.Decimal(precision: 18, scale: 2), - UnitsInStock = c.Short(), - UnitsOnOrder = c.Short(), - ReorderLevel = c.Short(), - Discontinued = c.Boolean(nullable: false), - }) - .PrimaryKey(t => t.ProductID) - .ForeignKey("dbo.Categories", t => t.CategoryID) - .ForeignKey("dbo.Suppliers", t => t.SupplierID) - .Index(t => t.SupplierID) - .Index(t => t.CategoryID); - - CreateTable( - "dbo.Suppliers", - c => new - { - SupplierID = c.Int(nullable: false, identity: true), - CompanyName = c.String(), - ContactName = c.String(), - ContactTitle = c.String(), - Address = c.String(), - City = c.String(), - Region = c.String(), - PostalCode = c.String(), - Country = c.String(), - Phone = c.String(), - Fax = c.String(), - HomePage = c.String(), - }) - .PrimaryKey(t => t.SupplierID); - - CreateTable( - "dbo.Shippers", - c => new - { - ShipperID = c.Int(nullable: false, identity: true), - CompanyName = c.String(), - Phone = c.String(), - }) - .PrimaryKey(t => t.ShipperID); - - } - - public override void Down() - { - DropForeignKey("dbo.Order_Details", "ProductID", "dbo.Products"); - DropForeignKey("dbo.Products", "SupplierID", "dbo.Suppliers"); - DropForeignKey("dbo.Products", "CategoryID", "dbo.Categories"); - DropForeignKey("dbo.Order_Details", "OrderID", "dbo.Orders"); - DropForeignKey("dbo.Orders", "EmployeeID", "dbo.Employees"); - DropForeignKey("dbo.Orders", "CustomerID", "dbo.Customers"); - DropForeignKey("dbo.Employees", "ReportsTo", "dbo.Employees"); - DropIndex("dbo.Products", new[] { "CategoryID" }); - DropIndex("dbo.Products", new[] { "SupplierID" }); - DropIndex("dbo.Order_Details", new[] { "ProductID" }); - DropIndex("dbo.Order_Details", new[] { "OrderID" }); - DropIndex("dbo.Orders", new[] { "EmployeeID" }); - DropIndex("dbo.Orders", new[] { "CustomerID" }); - DropIndex("dbo.Employees", new[] { "ReportsTo" }); - DropTable("dbo.Shippers"); - DropTable("dbo.Suppliers"); - DropTable("dbo.Products"); - DropTable("dbo.Order_Details"); - DropTable("dbo.Orders"); - DropTable("dbo.Employees"); - DropTable("dbo.Customers"); - DropTable("dbo.Categories"); - } - } -} diff --git a/Wpf/EqDemoWpfNet4/Migrations/202101141900542_IntitalCreate.resx b/Wpf/EqDemoWpfNet4/Migrations/202101141900542_IntitalCreate.resx deleted file mode 100644 index f0c0df5c..00000000 --- a/Wpf/EqDemoWpfNet4/Migrations/202101141900542_IntitalCreate.resx +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - H4sIAAAAAAAEAO1d3W7juBW+L9B3EHzVFrNxklkU28DZRSaZdINOfhpnBr0LGIlxhJUlj0QHCYp9sl70kfoKJfXDf0okJdmeQZCbmBS/Q5GH5xwdUp/+95//zn55WSbBM8yLOEuPJwd7+5MApmEWxenieLJGjz/8NPnl5z/+YfYxWr4EX5rr3p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kF32dV20gLTu0iuAneHu3hIe7DZ+d+GFbCf/2+NiXjD1MBaohl/Bkh/ssW+1L4+5IrfE50wY7Xi/YcL0a9CxORHJuvnQ8w0OC6H25wUQZt88xK5S8TAjNSLZ050oezdph60vHTgkv4YTQ++KYpfh+n77nyKy6QaU+mj+pVWqRti6VU50uSZ1NLvvraS71bnto8n0QM5bVE9UrfwFyoy6DOPKoNWaWUYaUNlESysVkSwKp0IMzenLKKO3BT8ulwHbiC61CI3a0eP39QapdwbmAdNrMBtpMA6ITcmNkIZnzkmRQCr0kkw80AqIhrWYFVCU6MVQHmIJfxNsg1riWE19sKUCrJovV1GYXmxi8R0bTcqLDCOZ2So2xuEMth/Hke+vcE5gbu7ag4MDBwH/W9VeXjqx/grez+RhbPtdiUzKrxJP9xtDsTnK9tk8ZXe7d3mKHS9Dl0eUYEdqHjV9+lwVLhOyVHH6tcZLOIFg5hhzBSGQjxIr7lIH7MmMpV61Fwi7aBc4luLcLB4kqP4EYQIV4ewKMrPT34Bybo0eg8wukiv12i1RviW4fIhEZYHCW/b5Jd8w2KfZ9fli1/FELeAuxmT06HX6Yd1nES03+eaXXwDBImb620uMpeIbHctXinSlfKupgmoHj4a7t9B7BwwWHGdzsEz9Onb5wJ+ggsQvt7Ur0WaQbonQhz22VkMFjlYFjUGa49/Yh2Oli8//x+XuC2CcqAAAA== - - - dbo - - \ No newline at end of file diff --git a/Wpf/EqDemoWpfNet4/Migrations/Configuration.cs b/Wpf/EqDemoWpfNet4/Migrations/Configuration.cs deleted file mode 100644 index 5d6772f0..00000000 --- a/Wpf/EqDemoWpfNet4/Migrations/Configuration.cs +++ /dev/null @@ -1,32 +0,0 @@ -namespace EqDemo.Migrations -{ - using Korzh.DbUtils; - using System; - using System.Data.Entity; - using System.Data.Entity.Migrations; - using System.IO; - using System.Linq; - - internal sealed class Configuration : DbMigrationsConfiguration - { - public Configuration() - { - AutomaticMigrationsEnabled = false; - ContextKey = "EqDemo.Models.ApplicationDbContext"; - } - - protected override void Seed(EqDemo.Models.ApplicationDbContext context) - { - // This method will be called after migrating to the latest version. - - // You can use the DbSet.AddOrUpdate() helper extension method - // to avoid creating duplicate seed data. - - Korzh.DbUtils.DbInitializer.Create(options => { - options.UseSqlServer(context.Database.Connection.ConnectionString); - options.UseZipPacker(Path.Combine(Directory.GetCurrentDirectory(), "App_Data/EqDemoData.zip")); - }) - .Seed(); - } - } -} diff --git a/Wpf/EqDemoWpfNet4/Properties/AssemblyInfo.cs b/Wpf/EqDemoWpfNet4/Properties/AssemblyInfo.cs deleted file mode 100644 index 8531f2e3..00000000 --- a/Wpf/EqDemoWpfNet4/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System.Reflection; -using System.Resources; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Windows; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("EqWpfDemo")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("EqWpfDemo")] -[assembly: AssemblyCopyright("Copyright © 2019")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -//In order to begin building localizable applications, set -//CultureYouAreCodingWith in your .csproj file -//inside a . For example, if you are using US english -//in your source files, set the to en-US. Then uncomment -//the NeutralResourceLanguage attribute below. Update the "en-US" in -//the line below to match the UICulture setting in the project file. - -//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] - - -[assembly: ThemeInfo( - ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located - //(used if a resource is not found in the page, - // or application resource dictionaries) - ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located - //(used if a resource is not found in the page, - // app, or any theme specific resource dictionaries) -)] - - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Wpf/EqDemoWpfNet6/EqDemoWpfNet6.csproj b/Wpf/EqDemoWpfNet6/EqDemoWpfNet6.csproj index a33b5046..38d71823 100644 --- a/Wpf/EqDemoWpfNet6/EqDemoWpfNet6.csproj +++ b/Wpf/EqDemoWpfNet6/EqDemoWpfNet6.csproj @@ -1,7 +1,7 @@ WinExe - net6.0-windows + net8.0-windows true EqDemo @@ -64,4 +64,4 @@ Designer - \ No newline at end of file +