diff --git a/omnisharp.json b/omnisharp.json index ae3aca17..5df81efa 100644 --- a/omnisharp.json +++ b/omnisharp.json @@ -1,17 +1,12 @@ { "dotnet": { - "enabled": true - }, - "msbuild": { "enabled": false }, - "scriptcs": { + "msbuild": { "enabled": true }, "Dnx": { - "enabled": false, - "enablePackageRestore": false, - "projects": "src/*/project.json;*/project.json;project.json;test/*/project.json" + "enabled": false }, "Script": { "enabled": false @@ -24,5 +19,4 @@ ], "userExcludeSearchPatterns": [] } - } diff --git a/src/Yavsc/ApiControllers/Blogspot/BlogApiController.cs b/src/Yavsc/ApiControllers/Blogspot/BlogApiController.cs index dcf59100..83e8d314 100644 --- a/src/Yavsc/ApiControllers/Blogspot/BlogApiController.cs +++ b/src/Yavsc/ApiControllers/Blogspot/BlogApiController.cs @@ -1,10 +1,11 @@ using System.Collections.Generic; using System.Linq; using System.Security.Claims; -using Microsoft.AspNet.Authorization; -using Microsoft.AspNet.Http; -using Microsoft.AspNet.Mvc; -using Microsoft.Data.Entity; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; +using Yavsc.Helpers; using Yavsc.Models; using Yavsc.Models.Blog; @@ -36,14 +37,14 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } BlogPost blog = _context.Blogspot.Single(m => m.Id == id); if (blog == null) { - return HttpNotFound(); + return NotFound(); } return Ok(blog); @@ -55,12 +56,12 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } if (id != blog.Id) { - return HttpBadRequest(); + return BadRequest(); } _context.Entry(blog).State = EntityState.Modified; @@ -73,7 +74,7 @@ namespace Yavsc.Controllers { if (!BlogExists(id)) { - return HttpNotFound(); + return NotFound(); } else { @@ -81,7 +82,7 @@ namespace Yavsc.Controllers } } - return new HttpStatusCodeResult(StatusCodes.Status204NoContent); + return new StatusCodeResult(StatusCodes.Status204NoContent); } // POST: api/BlogApi @@ -90,7 +91,7 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } _context.Blogspot.Add(blog); @@ -102,7 +103,7 @@ namespace Yavsc.Controllers { if (BlogExists(blog.Id)) { - return new HttpStatusCodeResult(StatusCodes.Status409Conflict); + return new StatusCodeResult(StatusCodes.Status409Conflict); } else { @@ -119,13 +120,13 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } BlogPost blog = _context.Blogspot.Single(m => m.Id == id); if (blog == null) { - return HttpNotFound(); + return NotFound(); } _context.Blogspot.Remove(blog); diff --git a/src/Yavsc/ApiControllers/Blogspot/BlogTagsApiController.cs b/src/Yavsc/ApiControllers/Blogspot/BlogTagsApiController.cs index bac327e1..a5f9cbac 100644 --- a/src/Yavsc/ApiControllers/Blogspot/BlogTagsApiController.cs +++ b/src/Yavsc/ApiControllers/Blogspot/BlogTagsApiController.cs @@ -1,9 +1,9 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; -using Microsoft.AspNet.Http; -using Microsoft.AspNet.Mvc; -using Microsoft.Data.Entity; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; using Yavsc.Models; using Yavsc.Models.Blog; namespace Yavsc.Controllers @@ -32,14 +32,14 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } BlogTag blogTag = await _context.TagsDomain.SingleAsync(m => m.PostId == id); if (blogTag == null) { - return HttpNotFound(); + return NotFound(); } return Ok(blogTag); @@ -51,12 +51,12 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } if (id != blogTag.PostId) { - return HttpBadRequest(); + return BadRequest(); } _context.Entry(blogTag).State = EntityState.Modified; @@ -69,7 +69,7 @@ namespace Yavsc.Controllers { if (!BlogTagExists(id)) { - return HttpNotFound(); + return NotFound(); } else { @@ -77,7 +77,7 @@ namespace Yavsc.Controllers } } - return new HttpStatusCodeResult(StatusCodes.Status204NoContent); + return new StatusCodeResult(StatusCodes.Status204NoContent); } // POST: api/BlogTagsApi @@ -86,7 +86,7 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } _context.TagsDomain.Add(blogTag); @@ -98,7 +98,7 @@ namespace Yavsc.Controllers { if (BlogTagExists(blogTag.PostId)) { - return new HttpStatusCodeResult(StatusCodes.Status409Conflict); + return new StatusCodeResult(StatusCodes.Status409Conflict); } else { @@ -115,13 +115,13 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } BlogTag blogTag = await _context.TagsDomain.SingleAsync(m => m.PostId == id); if (blogTag == null) { - return HttpNotFound(); + return NotFound(); } _context.TagsDomain.Remove(blogTag); diff --git a/src/Yavsc/ApiControllers/Blogspot/CommentsApiController.cs b/src/Yavsc/ApiControllers/Blogspot/CommentsApiController.cs index 07108689..879f0b43 100644 --- a/src/Yavsc/ApiControllers/Blogspot/CommentsApiController.cs +++ b/src/Yavsc/ApiControllers/Blogspot/CommentsApiController.cs @@ -1,10 +1,7 @@ -using System.Collections.Generic; -using System.Linq; -using System.Security.Claims; -using System.Threading.Tasks; -using Microsoft.AspNet.Http; -using Microsoft.AspNet.Mvc; -using Microsoft.Data.Entity; + +using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; +using Yavsc.Helpers; using Yavsc.Models; using Yavsc.Models.Blog; @@ -34,14 +31,14 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } Comment comment = await _context.Comment.SingleAsync(m => m.Id == id); if (comment == null) { - return HttpNotFound(); + return NotFound(); } return Ok(comment); @@ -53,12 +50,12 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } if (id != comment.Id) { - return HttpBadRequest(); + return BadRequest(); } _context.Entry(comment).State = EntityState.Modified; @@ -71,7 +68,7 @@ namespace Yavsc.Controllers { if (!CommentExists(id)) { - return HttpNotFound(); + return NotFound(); } else { @@ -79,7 +76,7 @@ namespace Yavsc.Controllers } } - return new HttpStatusCodeResult(StatusCodes.Status204NoContent); + return new StatusCodeResult(StatusCodes.Status204NoContent); } // POST: api/CommentsApi @@ -106,7 +103,7 @@ namespace Yavsc.Controllers { if (CommentExists(comment.Id)) { - return new HttpStatusCodeResult(StatusCodes.Status409Conflict); + return new StatusCodeResult(StatusCodes.Status409Conflict); } else { @@ -122,13 +119,13 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } Comment comment = await _context.Comment.SingleAsync(m => m.Id == id); if (comment == null) { - return HttpNotFound(); + return NotFound(); } RemoveRecursive(comment); diff --git a/src/Yavsc/ApiControllers/Blogspot/FileSystemApiController.cs b/src/Yavsc/ApiControllers/Blogspot/FileSystemApiController.cs index 13e9aec1..ec0583cf 100644 --- a/src/Yavsc/ApiControllers/Blogspot/FileSystemApiController.cs +++ b/src/Yavsc/ApiControllers/Blogspot/FileSystemApiController.cs @@ -1,9 +1,7 @@ -using System; -using System.Collections.Generic; -using System.Linq; + using System.Security.Claims; -using Microsoft.AspNet.Authorization; -using Microsoft.AspNet.Mvc; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; using Yavsc.Models; namespace Yavsc.ApiControllers @@ -63,11 +61,11 @@ namespace Yavsc.ApiControllers } if (pathex!=null) { _logger.LogError($"invalid sub path: '{subdir}'."); - return HttpBadRequest(pathex); + return BadRequest(pathex); } _logger.LogInformation($"Receiving files, saved in '{destDir}' (specified as '{subdir}')."); - var uid = User.GetUserId(); + var uid = User.FindFirstValue(ClaimTypes.NameIdentifier); var user = dbContext.Users.Single( u => u.Id == uid ); @@ -91,7 +89,7 @@ namespace Yavsc.ApiControllers [Authorize("AdministratorOnly")] public IActionResult AddQuota(string uname, int len) { - var uid = User.GetUserId(); + var uid = User.FindFirstValue(ClaimTypes.NameIdentifier); var user = dbContext.Users.FirstOrDefault( u => u.UserName == uname ); @@ -107,7 +105,7 @@ namespace Yavsc.ApiControllers public IActionResult MoveFile([FromBody] RenameFileQuery query) { if (!ModelState.IsValid) return new BadRequestObjectResult(ModelState); - var uid = User.GetUserId(); + var uid = User.FindFirstValue(ClaimTypes.NameIdentifier); var user = dbContext.Users.Single( u => u.Id == uid ); @@ -124,10 +122,10 @@ namespace Yavsc.ApiControllers if (!ModelState.IsValid) { var idvr = new ValidRemoteUserFilePathAttribute(); - return this.HttpBadRequest(new { id = idvr.IsValid(query.id), to = idvr.IsValid(query.to), errors = ModelState }); + return this.BadRequest(new { id = idvr.IsValid(query.id), to = idvr.IsValid(query.to), errors = ModelState }); } _logger.LogInformation($"Valid move query: {query.id} => {query.to}"); - var uid = User.GetUserId(); + var uid = User.FindFirstValue(ClaimTypes.NameIdentifier); var user = dbContext.Users.Single( u => u.Id == uid ); diff --git a/src/Yavsc/ApiControllers/Blogspot/FileSystemStream.cs b/src/Yavsc/ApiControllers/Blogspot/FileSystemStream.cs index adbbd796..39c6beac 100644 --- a/src/Yavsc/ApiControllers/Blogspot/FileSystemStream.cs +++ b/src/Yavsc/ApiControllers/Blogspot/FileSystemStream.cs @@ -1,16 +1,13 @@ -using System.IO; -using System.Linq; -using System.Security.Claims; -using System.Threading.Tasks; -using Microsoft.AspNet.Authorization; -using Microsoft.AspNet.Mvc; -using Microsoft.Data.Entity; -using Microsoft.Extensions.Logging; + +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; using Yavsc.Attributes.Validation; using Yavsc.Helpers; using Yavsc.Models; using Yavsc.Models.Messaging; using Yavsc.Services; +using Microsoft.AspNetCore.SignalR; namespace Yavsc.ApiControllers { @@ -19,13 +16,16 @@ namespace Yavsc.ApiControllers { private readonly ILogger logger; private readonly ILiveProcessor liveProcessor; + private readonly IHubContext hubContext; readonly ApplicationDbContext dbContext; - public FileSystemStreamController(ApplicationDbContext context, ILiveProcessor liveProcessor, ILoggerFactory loggerFactory) + public FileSystemStreamController(ApplicationDbContext context, ILiveProcessor liveProcessor, ILoggerFactory loggerFactory, + IHubContext hubContext) { this.dbContext = context; this.logger = loggerFactory.CreateLogger(); this.liveProcessor = liveProcessor; + this.hubContext = hubContext; } [Authorize, Route("put/{filename}")] @@ -33,20 +33,20 @@ namespace Yavsc.ApiControllers { logger.LogInformation("Put : " + filename); if (!HttpContext.WebSockets.IsWebSocketRequest) - return HttpBadRequest("not a web socket"); + return BadRequest("not a web socket"); if (!HttpContext.User.Identity.IsAuthenticated) - return new HttpUnauthorizedResult(); + return new UnauthorizedResult(); var subdirs = filename.Split('/'); var filePath = subdirs.Length > 1 ? string.Join("/", subdirs.Take(subdirs.Length-1)) : null; var shortFileName = subdirs[subdirs.Length-1]; if (!shortFileName.IsValidShortFileName()) { logger.LogInformation("invalid file name : " + filename); - return HttpBadRequest("invalid file name"); + return BadRequest("invalid file name"); } logger.LogInformation("validated: api/stream/Put: "+filename); var userName = User.GetUserName(); - var hubContext = Microsoft.AspNet.SignalR.GlobalHost.ConnectionManager.GetHubContext(); + string url = string.Format( "{0}/{1}/{2}", Startup.UserFilesOptions.RequestPath.ToUriComponent(), @@ -54,7 +54,7 @@ namespace Yavsc.ApiControllers filename ); - hubContext.Clients.All.addPublicStream(new PublicStreamInfo + hubContext.Clients.All.SendAsync("addPublicStream", new PublicStreamInfo { sender = userName, url = url, diff --git a/src/Yavsc/ApiControllers/Blogspot/PostTagsApiController.cs b/src/Yavsc/ApiControllers/Blogspot/PostTagsApiController.cs index 9ab94975..58bd53e5 100644 --- a/src/Yavsc/ApiControllers/Blogspot/PostTagsApiController.cs +++ b/src/Yavsc/ApiControllers/Blogspot/PostTagsApiController.cs @@ -1,13 +1,14 @@ using System.Collections.Generic; using System.Linq; -using Microsoft.AspNet.Http; -using Microsoft.AspNet.Mvc; -using Microsoft.Data.Entity; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; namespace Yavsc.Controllers { using System.Security.Claims; - using Models; + using Microsoft.EntityFrameworkCore; + using Models; + using Yavsc.Helpers; using Yavsc.Models.Blog; [Produces("application/json")] @@ -34,14 +35,14 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } BlogTag postTag = _context.TagsDomain.Single(m => m.PostId == id); if (postTag == null) { - return HttpNotFound(); + return NotFound(); } return Ok(postTag); @@ -53,12 +54,12 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } if (id != postTag.PostId) { - return HttpBadRequest(); + return BadRequest(); } _context.Entry(postTag).State = EntityState.Modified; @@ -71,7 +72,7 @@ namespace Yavsc.Controllers { if (!PostTagExists(id)) { - return HttpNotFound(); + return NotFound(); } else { @@ -79,7 +80,7 @@ namespace Yavsc.Controllers } } - return new HttpStatusCodeResult(StatusCodes.Status204NoContent); + return new StatusCodeResult(StatusCodes.Status204NoContent); } // POST: api/PostTagsApi @@ -88,7 +89,7 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } _context.TagsDomain.Add(postTag); @@ -100,7 +101,7 @@ namespace Yavsc.Controllers { if (PostTagExists(postTag.PostId)) { - return new HttpStatusCodeResult(StatusCodes.Status409Conflict); + return new StatusCodeResult(StatusCodes.Status409Conflict); } else { @@ -117,13 +118,13 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } BlogTag postTag = _context.TagsDomain.Single(m => m.PostId == id); if (postTag == null) { - return HttpNotFound(); + return NotFound(); } _context.TagsDomain.Remove(postTag); @@ -146,4 +147,4 @@ namespace Yavsc.Controllers return _context.TagsDomain.Count(e => e.PostId == id) > 0; } } -} \ No newline at end of file +} diff --git a/src/Yavsc/ApiControllers/Blogspot/TagsApiController.cs b/src/Yavsc/ApiControllers/Blogspot/TagsApiController.cs index 8422f3c1..5a86e24c 100644 --- a/src/Yavsc/ApiControllers/Blogspot/TagsApiController.cs +++ b/src/Yavsc/ApiControllers/Blogspot/TagsApiController.cs @@ -1,15 +1,14 @@ -using System.Collections.Generic; -using System.Linq; -using Microsoft.AspNet.Http; -using Microsoft.AspNet.Mvc; -using Microsoft.Extensions.Logging; -using Microsoft.Data.Entity; + +using Microsoft.AspNetCore.Mvc; using Yavsc.Models; namespace Yavsc.Controllers { using System.Security.Claims; + using Microsoft.EntityFrameworkCore; using Models.Relationship; + using Yavsc.Helpers; + [Produces("application/json")] [Route("api/TagsApi")] public class TagsApiController : Controller @@ -37,14 +36,14 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } Tag tag = _context.Tags.Single(m => m.Id == id); if (tag == null) { - return HttpNotFound(); + return NotFound(); } return Ok(tag); @@ -56,12 +55,12 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } if (id != tag.Id) { - return HttpBadRequest(); + return BadRequest(); } _context.Entry(tag).State = EntityState.Modified; @@ -75,7 +74,7 @@ namespace Yavsc.Controllers { if (!TagExists(id)) { - return HttpNotFound(); + return NotFound(); } else { @@ -83,7 +82,7 @@ namespace Yavsc.Controllers } } - return new HttpStatusCodeResult(StatusCodes.Status204NoContent); + return new StatusCodeResult(StatusCodes.Status204NoContent); } // POST: api/TagsApi @@ -92,7 +91,7 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } _context.Tags.Add(tag); @@ -104,7 +103,7 @@ namespace Yavsc.Controllers { if (TagExists(tag.Id)) { - return new HttpStatusCodeResult(StatusCodes.Status409Conflict); + return new StatusCodeResult(StatusCodes.Status409Conflict); } else { @@ -121,13 +120,13 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } Tag tag = _context.Tags.Single(m => m.Id == id); if (tag == null) { - return HttpNotFound(); + return NotFound(); } _context.Tags.Remove(tag); diff --git a/src/Yavsc/ApiControllers/Blogspot/TestApiController.cs b/src/Yavsc/ApiControllers/Blogspot/TestApiController.cs index c21783ad..69088a79 100644 --- a/src/Yavsc/ApiControllers/Blogspot/TestApiController.cs +++ b/src/Yavsc/ApiControllers/Blogspot/TestApiController.cs @@ -1,5 +1,5 @@ -using Microsoft.AspNet.Authorization; -using Microsoft.AspNet.Mvc; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; namespace Yavsc.ApiControllers { diff --git a/src/Yavsc/ApiControllers/Business/ActivityApiController.cs b/src/Yavsc/ApiControllers/Business/ActivityApiController.cs index b703bfe9..c661857a 100644 --- a/src/Yavsc/ApiControllers/Business/ActivityApiController.cs +++ b/src/Yavsc/ApiControllers/Business/ActivityApiController.cs @@ -2,10 +2,11 @@ using System.Collections.Generic; using System.Linq; using System.Security.Claims; using System.Threading.Tasks; -using Microsoft.AspNet.Authorization; -using Microsoft.AspNet.Http; -using Microsoft.AspNet.Mvc; -using Microsoft.Data.Entity; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; +using Yavsc.Helpers; using Yavsc.Models; using Yavsc.Models.Workflow; @@ -37,14 +38,14 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } Activity activity = await _context.Activities.SingleAsync(m => m.Code == id); if (activity == null) { - return HttpNotFound(); + return NotFound(); } // Also return hidden ones // hidden doesn't mean disabled @@ -57,12 +58,12 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } if (id != activity.Code) { - return HttpBadRequest(); + return BadRequest(); } _context.Entry(activity).State = EntityState.Modified; @@ -75,7 +76,7 @@ namespace Yavsc.Controllers { if (!ActivityExists(id)) { - return HttpNotFound(); + return NotFound(); } else { @@ -83,7 +84,7 @@ namespace Yavsc.Controllers } } - return new HttpStatusCodeResult(StatusCodes.Status204NoContent); + return new StatusCodeResult(StatusCodes.Status204NoContent); } // POST: api/ActivityApi @@ -92,7 +93,7 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } _context.Activities.Add(activity); @@ -104,7 +105,7 @@ namespace Yavsc.Controllers { if (ActivityExists(activity.Code)) { - return new HttpStatusCodeResult(StatusCodes.Status409Conflict); + return new StatusCodeResult(StatusCodes.Status409Conflict); } else { @@ -121,13 +122,13 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } Activity activity = await _context.Activities.SingleAsync(m => m.Code == id); if (activity == null) { - return HttpNotFound(); + return NotFound(); } _context.Activities.Remove(activity); diff --git a/src/Yavsc/ApiControllers/Business/BillingController.cs b/src/Yavsc/ApiControllers/Business/BillingController.cs index 4994ca8f..9a17bea1 100644 --- a/src/Yavsc/ApiControllers/Business/BillingController.cs +++ b/src/Yavsc/ApiControllers/Business/BillingController.cs @@ -1,15 +1,7 @@ -using System.IO; -using Microsoft.AspNet.Authorization; -using Microsoft.AspNet.Mvc; -using System.Web.Routing; -using System.Linq; -using Microsoft.Data.Entity; -using System.Threading.Tasks; -using Microsoft.Extensions.Logging; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Localization; -using Microsoft.Extensions.OptionsModel; using Newtonsoft.Json; -using System; using System.Security.Claims; using Yavsc.Helpers; using Yavsc.ViewModels; @@ -21,6 +13,8 @@ namespace Yavsc.ApiControllers using Models.Messaging; using ViewModels.Auth; + using Microsoft.Extensions.Options; + using Microsoft.EntityFrameworkCore; [Route("api/bill"), Authorize] public class BillingController : Controller @@ -59,7 +53,7 @@ namespace Yavsc.ApiControllers { var bill = await billingService.GetBillAsync(billingCode, id); - if (!await authorizationService.AuthorizeAsync(User, bill, new ViewRequirement())) + if ( authorizationService.AuthorizeAsync(User, bill, new ViewRequirement()).IsFaulted) { return new ChallengeResult(); } @@ -77,11 +71,11 @@ namespace Yavsc.ApiControllers if (bill==null) { logger.LogCritical ( $"# not found !! {id} in {billingCode}"); - return this.HttpNotFound(); + return this.NotFound(); } - logger.LogVerbose(JsonConvert.SerializeObject(bill)); + logger.LogTrace(JsonConvert.SerializeObject(bill)); - if (!await authorizationService.AuthorizeAsync(User, bill, new ViewRequirement())) + if (!(await authorizationService.AuthorizeAsync(User, bill, new ViewRequirement())).Succeeded) { return new ChallengeResult(); } @@ -96,7 +90,7 @@ namespace Yavsc.ApiControllers if (bill==null) { logger.LogCritical ( $"# not found !! {id} in {billingCode}"); - return this.HttpNotFound(); + return this.NotFound(); } logger.LogWarning("Got bill ack:"+bill.GetIsAcquitted().ToString()); return ViewComponent("Bill",new object[] { billingCode, bill, OutputFormat.Pdf, true } ); @@ -112,7 +106,9 @@ namespace Yavsc.ApiControllers .FirstOrDefault(e=>e.Id == id); if (estimate == null) return new BadRequestResult(); - if (!await authorizationService.AuthorizeAsync(User, estimate, new ViewRequirement())) + if (!(await authorizationService.AuthorizeAsync(User, estimate, new ViewRequirement())).Succeeded) + + { return new ChallengeResult(); } @@ -138,25 +134,26 @@ namespace Yavsc.ApiControllers { // For authorization purpose var estimate = dbContext.Estimates.FirstOrDefault(e=>e.Id == id); - if (!await authorizationService.AuthorizeAsync(User, estimate, new ViewRequirement())) + if (!(await authorizationService.AuthorizeAsync(User, estimate, new ViewRequirement())).Succeeded) + { return new ChallengeResult(); } var filename = AbstractFileSystemHelpers.SignFileNameFormat("pro", billingCode, id); FileInfo fi = new FileInfo(Path.Combine(AbstractFileSystemHelpers.UserBillsDirName, filename)); - if (!fi.Exists) return HttpNotFound(new { Error = "Professional signature not found" }); + if (!fi.Exists) return NotFound(new { Error = "Professional signature not found" }); return File(fi.OpenRead(), "application/x-pdf", filename); ; } [HttpPost("clisign/{billingCode}/{id}")] public async Task CliSign(string billingCode, long id) { - var uid = User.GetUserId(); + var uid = User.FindFirstValue(ClaimTypes.NameIdentifier); var estimate = dbContext.Estimates.Include( e=>e.Query ).Include(e=>e.Owner).Include(e=>e.Owner.Performer).Include(e=>e.Client) .FirstOrDefault( e=> e.Id == id && e.Query.ClientId == uid ); - if (!await authorizationService.AuthorizeAsync(User, estimate, new ViewRequirement())) + if (!(await authorizationService.AuthorizeAsync(User, estimate, new ViewRequirement())).Succeeded) { return new ChallengeResult(); } @@ -173,14 +170,14 @@ namespace Yavsc.ApiControllers { // For authorization purpose var estimate = dbContext.Estimates.FirstOrDefault(e=>e.Id == id); - if (!await authorizationService.AuthorizeAsync(User, estimate, new ViewRequirement())) + if (!(await authorizationService.AuthorizeAsync(User, estimate, new ViewRequirement())).Succeeded) { return new ChallengeResult(); } var filename = AbstractFileSystemHelpers.SignFileNameFormat("pro", billingCode, id); FileInfo fi = new FileInfo(Path.Combine(AbstractFileSystemHelpers.UserBillsDirName, filename)); - if (!fi.Exists) return HttpNotFound(new { Error = "Professional signature not found" }); + if (!fi.Exists) return NotFound(new { Error = "Professional signature not found" }); return File(fi.OpenRead(), "application/x-pdf", filename); ; } } diff --git a/src/Yavsc/ApiControllers/Business/BookQueryApiController.cs b/src/Yavsc/ApiControllers/Business/BookQueryApiController.cs index 442de9d9..f8e9282f 100644 --- a/src/Yavsc/ApiControllers/Business/BookQueryApiController.cs +++ b/src/Yavsc/ApiControllers/Business/BookQueryApiController.cs @@ -1,10 +1,9 @@ using System.Collections.Generic; using System.Linq; using System.Security.Claims; -using Microsoft.AspNet.Authorization; -using Microsoft.AspNet.Http; -using Microsoft.AspNet.Mvc; -using Microsoft.Data.Entity; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Logging; namespace Yavsc.Controllers @@ -14,6 +13,8 @@ namespace Yavsc.Controllers using Yavsc.Models.Workflow; using Yavsc.Models.Billing; using Yavsc.Abstract.Identity; + using Microsoft.EntityFrameworkCore; + using Yavsc.Helpers; [Produces("application/json")] [Route("api/bookquery"), Authorize(Roles = "Performer,Administrator")] @@ -37,7 +38,7 @@ namespace Yavsc.Controllers [HttpGet] public IEnumerable GetCommands(long maxId=long.MaxValue) { - var uid = User.GetUserId(); + var uid = User.FindFirstValue(ClaimTypes.NameIdentifier); var now = DateTime.Now; var result = _context.RdvQueries.Include(c => c.Location). @@ -69,15 +70,15 @@ namespace Yavsc.Controllers if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } - var uid = User.GetUserId(); + var uid = User.FindFirstValue(ClaimTypes.NameIdentifier); RdvQuery bookQuery = _context.RdvQueries.Where(c => c.ClientId == uid || c.PerformerId == uid).Single(m => m.Id == id); if (bookQuery == null) { - return HttpNotFound(); + return NotFound(); } return Ok(bookQuery); @@ -89,16 +90,16 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } if (id != bookQuery.Id) { - return HttpBadRequest(); + return BadRequest(); } - var uid = User.GetUserId(); + var uid = User.FindFirstValue(ClaimTypes.NameIdentifier); if (bookQuery.ClientId != uid) - return HttpNotFound(); + return NotFound(); _context.Entry(bookQuery).State = EntityState.Modified; @@ -110,7 +111,7 @@ namespace Yavsc.Controllers { if (!BookQueryExists(id)) { - return HttpNotFound(); + return NotFound(); } else { @@ -118,7 +119,7 @@ namespace Yavsc.Controllers } } - return new HttpStatusCodeResult(StatusCodes.Status204NoContent); + return new StatusCodeResult(StatusCodes.Status204NoContent); } // POST: api/BookQueryApi @@ -127,9 +128,9 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } - var uid = User.GetUserId(); + var uid = User.FindFirstValue(ClaimTypes.NameIdentifier); if (bookQuery.ClientId != uid) { ModelState.AddModelError("ClientId", "You must be the client at creating a book query"); @@ -144,7 +145,7 @@ namespace Yavsc.Controllers { if (BookQueryExists(bookQuery.Id)) { - return new HttpStatusCodeResult(StatusCodes.Status409Conflict); + return new StatusCodeResult(StatusCodes.Status409Conflict); } else { @@ -161,16 +162,16 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } - var uid = User.GetUserId(); + var uid = User.FindFirstValue(ClaimTypes.NameIdentifier); RdvQuery bookQuery = _context.RdvQueries.Single(m => m.Id == id); if (bookQuery == null) { - return HttpNotFound(); + return NotFound(); } - if (bookQuery.ClientId != uid) return HttpNotFound(); + if (bookQuery.ClientId != uid) return NotFound(); _context.RdvQueries.Remove(bookQuery); _context.SaveChanges(User.GetUserId()); @@ -192,4 +193,4 @@ namespace Yavsc.Controllers return _context.RdvQueries.Count(e => e.Id == id) > 0; } } -} \ No newline at end of file +} diff --git a/src/Yavsc/ApiControllers/Business/EstimateApiController.cs b/src/Yavsc/ApiControllers/Business/EstimateApiController.cs index 5e9e2719..63e58da9 100644 --- a/src/Yavsc/ApiControllers/Business/EstimateApiController.cs +++ b/src/Yavsc/ApiControllers/Business/EstimateApiController.cs @@ -1,12 +1,13 @@ using System; using System.Linq; using System.Security.Claims; -using Microsoft.AspNet.Authorization; -using Microsoft.AspNet.Http; -using Microsoft.AspNet.Mvc; -using Microsoft.Data.Entity; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; using Newtonsoft.Json; +using Yavsc.Helpers; using Yavsc.Models; using Yavsc.Models.Billing; @@ -41,7 +42,7 @@ namespace Yavsc.Controllers if (ownerId == null) ownerId = User.GetUserId(); else if (!UserIsAdminOrThis(ownerId)) // throw new Exception("Not authorized") ; // or just do nothing - return new HttpStatusCodeResult(StatusCodes.Status403Forbidden); + return new StatusCodeResult(StatusCodes.Status403Forbidden); return Ok(_context.Estimates.Include(e => e.Bill).Where(e => e.OwnerId == ownerId)); } // GET: api/Estimate/5 @@ -50,19 +51,19 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } Estimate estimate = _context.Estimates.Include(e => e.Bill).Single(m => m.Id == id); if (estimate == null) { - return HttpNotFound(); + return NotFound(); } if (UserIsAdminOrInThese(estimate.ClientId, estimate.OwnerId)) return Ok(estimate); - return new HttpStatusCodeResult(StatusCodes.Status403Forbidden); + return new StatusCodeResult(StatusCodes.Status403Forbidden); } // PUT: api/Estimate/5 @@ -77,15 +78,15 @@ namespace Yavsc.Controllers if (id != estimate.Id) { - return HttpBadRequest(); + return BadRequest(); } - var uid = User.GetUserId(); + var uid = User.FindFirstValue(ClaimTypes.NameIdentifier); if (!User.IsInRole(Constants.AdminGroupName)) { if (uid != estimate.OwnerId) { ModelState.AddModelError("OwnerId", "You can only modify your own estimates"); - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } } @@ -98,7 +99,7 @@ namespace Yavsc.Controllers { if (!EstimateExists(id)) { - return HttpNotFound(); + return NotFound(); } else { @@ -113,7 +114,7 @@ namespace Yavsc.Controllers [HttpPost, Produces("application/json")] public IActionResult PostEstimate([FromBody] Estimate estimate) { - var uid = User.GetUserId(); + var uid = User.FindFirstValue(ClaimTypes.NameIdentifier); if (estimate.OwnerId == null) estimate.OwnerId = uid; if (!User.IsInRole(Constants.AdminGroupName)) @@ -121,7 +122,7 @@ namespace Yavsc.Controllers if (uid != estimate.OwnerId) { ModelState.AddModelError("OwnerId", "You can only create your own estimates"); - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } } @@ -130,7 +131,7 @@ namespace Yavsc.Controllers var query = _context.RdvQueries.FirstOrDefault(q => q.Id == estimate.CommandId); if (query == null) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } query.ValidationDate = DateTime.Now; _context.SaveChanges(User.GetUserId()); @@ -159,7 +160,7 @@ namespace Yavsc.Controllers { if (EstimateExists(estimate.Id)) { - return new HttpStatusCodeResult(StatusCodes.Status409Conflict); + return new StatusCodeResult(StatusCodes.Status409Conflict); } else { @@ -175,22 +176,22 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } Estimate estimate = _context.Estimates.Include(e => e.Bill).Single(m => m.Id == id); if (estimate == null) { - return HttpNotFound(); + return NotFound(); } - var uid = User.GetUserId(); + var uid = User.FindFirstValue(ClaimTypes.NameIdentifier); if (!User.IsInRole(Constants.AdminGroupName)) { if (uid != estimate.OwnerId) { ModelState.AddModelError("OwnerId", "You can only create your own estimates"); - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } } _context.Estimates.Remove(estimate); diff --git a/src/Yavsc/ApiControllers/Business/EstimateTemplatesApiController.cs b/src/Yavsc/ApiControllers/Business/EstimateTemplatesApiController.cs index 9e58251f..a960b9d1 100644 --- a/src/Yavsc/ApiControllers/Business/EstimateTemplatesApiController.cs +++ b/src/Yavsc/ApiControllers/Business/EstimateTemplatesApiController.cs @@ -1,9 +1,7 @@ -using System.Collections.Generic; -using System.Linq; using System.Security.Claims; -using Microsoft.AspNet.Http; -using Microsoft.AspNet.Mvc; -using Microsoft.Data.Entity; +using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; +using Yavsc.Helpers; using Yavsc.Models; using Yavsc.Models.Billing; @@ -24,7 +22,7 @@ namespace Yavsc.Controllers [HttpGet] public IEnumerable GetEstimateTemplate() { - var uid = User.GetUserId(); + var uid = User.FindFirstValue(ClaimTypes.NameIdentifier); return _context.EstimateTemplates.Where(x=>x.OwnerId==uid); } @@ -34,15 +32,15 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } - var uid = User.GetUserId(); + var uid = User.FindFirstValue(ClaimTypes.NameIdentifier); EstimateTemplate estimateTemplate = _context.EstimateTemplates.Where(x=>x.OwnerId==uid).Single(m => m.Id == id); if (estimateTemplate == null) { - return HttpNotFound(); + return NotFound(); } return Ok(estimateTemplate); @@ -54,17 +52,17 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } if (id != estimateTemplate.Id) { - return HttpBadRequest(); + return BadRequest(); } - var uid = User.GetUserId(); + var uid = User.FindFirstValue(ClaimTypes.NameIdentifier); if (estimateTemplate.OwnerId!=uid) if (!User.IsInRole(Constants.AdminGroupName)) - return new HttpStatusCodeResult(StatusCodes.Status403Forbidden); + return new StatusCodeResult(StatusCodes.Status403Forbidden); _context.Entry(estimateTemplate).State = EntityState.Modified; @@ -76,7 +74,7 @@ namespace Yavsc.Controllers { if (!EstimateTemplateExists(id)) { - return HttpNotFound(); + return NotFound(); } else { @@ -84,7 +82,7 @@ namespace Yavsc.Controllers } } - return new HttpStatusCodeResult(StatusCodes.Status204NoContent); + return new StatusCodeResult(StatusCodes.Status204NoContent); } // POST: api/EstimateTemplatesApi @@ -93,7 +91,7 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } estimateTemplate.OwnerId=User.GetUserId(); @@ -106,7 +104,7 @@ namespace Yavsc.Controllers { if (EstimateTemplateExists(estimateTemplate.Id)) { - return new HttpStatusCodeResult(StatusCodes.Status409Conflict); + return new StatusCodeResult(StatusCodes.Status409Conflict); } else { @@ -123,18 +121,18 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } EstimateTemplate estimateTemplate = _context.EstimateTemplates.Single(m => m.Id == id); if (estimateTemplate == null) { - return HttpNotFound(); + return NotFound(); } - var uid = User.GetUserId(); + var uid = User.FindFirstValue(ClaimTypes.NameIdentifier); if (estimateTemplate.OwnerId!=uid) if (!User.IsInRole(Constants.AdminGroupName)) - return new HttpStatusCodeResult(StatusCodes.Status403Forbidden); + return new StatusCodeResult(StatusCodes.Status403Forbidden); _context.EstimateTemplates.Remove(estimateTemplate); _context.SaveChanges(User.GetUserId()); @@ -156,4 +154,4 @@ namespace Yavsc.Controllers return _context.EstimateTemplates.Count(e => e.Id == id) > 0; } } -} \ No newline at end of file +} diff --git a/src/Yavsc/ApiControllers/Business/FrontOfficeApiController.cs b/src/Yavsc/ApiControllers/Business/FrontOfficeApiController.cs index 13ac327c..fd23428a 100644 --- a/src/Yavsc/ApiControllers/Business/FrontOfficeApiController.cs +++ b/src/Yavsc/ApiControllers/Business/FrontOfficeApiController.cs @@ -1,6 +1,6 @@ using System; using System.Collections.Generic; -using Microsoft.AspNet.Mvc; +using Microsoft.AspNetCore.Mvc; using Yavsc.Helpers; using Yavsc.Models; using Yavsc.Services; @@ -30,10 +30,10 @@ namespace Yavsc.ApiControllers [HttpPost("query/reject")] public IActionResult RejectQuery(string billingCode, long queryId) { - if (billingCode == null) return HttpBadRequest("billingCode"); - if (queryId == 0) return HttpBadRequest("queryId"); + if (billingCode == null) return BadRequest("billingCode"); + if (queryId == 0) return BadRequest("queryId"); var billing = BillingService.GetBillable(dbContext, billingCode, queryId); - if (billing == null) return HttpBadRequest(); + if (billing == null) return BadRequest(); billing.Rejected = true; billing.RejectedAt = DateTime.Now; dbContext.SaveChanges(); diff --git a/src/Yavsc/ApiControllers/Business/PaymentApiController.cs b/src/Yavsc/ApiControllers/Business/PaymentApiController.cs index 32699c24..3076dbe1 100644 --- a/src/Yavsc/ApiControllers/Business/PaymentApiController.cs +++ b/src/Yavsc/ApiControllers/Business/PaymentApiController.cs @@ -1,7 +1,5 @@ -using System.Threading.Tasks; -using Microsoft.AspNet.Mvc; -using Microsoft.Extensions.Logging; -using Microsoft.Extensions.OptionsModel; +using Microsoft.AspNetCore.Mvc; +using Microsoft.Extensions.Options; using Newtonsoft.Json; using Yavsc.Helpers; using Yavsc.Models; diff --git a/src/Yavsc/ApiControllers/Business/PerformersApiController.cs b/src/Yavsc/ApiControllers/Business/PerformersApiController.cs index 9e825861..8f7603ae 100644 --- a/src/Yavsc/ApiControllers/Business/PerformersApiController.cs +++ b/src/Yavsc/ApiControllers/Business/PerformersApiController.cs @@ -1,12 +1,11 @@ -using Microsoft.AspNet.Mvc; -using System.Linq; +using Microsoft.AspNetCore.Mvc; using System.Security.Claims; -using Microsoft.AspNet.Authorization; -using Microsoft.Data.Entity; +using Microsoft.AspNetCore.Authorization; namespace Yavsc.Controllers { + using Microsoft.EntityFrameworkCore; using Models; using Yavsc.Helpers; using Yavsc.Services; @@ -44,7 +43,7 @@ namespace Yavsc.Controllers ModelState.AddModelError("id","Specifier un identifiant de prestataire valide"); } else { - var uid = User.GetUserId(); + var uid = User.FindFirstValue(ClaimTypes.NameIdentifier); if (!User.IsInRole("Administrator")) if (uid != id) return new ChallengeResult(); diff --git a/src/Yavsc/ApiControllers/Business/ProductApiController.cs b/src/Yavsc/ApiControllers/Business/ProductApiController.cs index fd4f5fb0..10382138 100644 --- a/src/Yavsc/ApiControllers/Business/ProductApiController.cs +++ b/src/Yavsc/ApiControllers/Business/ProductApiController.cs @@ -1,10 +1,7 @@ -using System.Collections.Generic; -using System.Linq; -using System.Security.Claims; -using Microsoft.AspNet.Authorization; -using Microsoft.AspNet.Http; -using Microsoft.AspNet.Mvc; -using Microsoft.Data.Entity; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; +using Yavsc.Helpers; using Yavsc.Models; using Yavsc.Models.Market; @@ -34,14 +31,14 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } Product product = _context.Products.Single(m => m.Id == id); if (product == null) { - return HttpNotFound(); + return NotFound(); } return Ok(product); @@ -53,12 +50,12 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } if (id != product.Id) { - return HttpBadRequest(); + return BadRequest(); } _context.Entry(product).State = EntityState.Modified; @@ -71,7 +68,7 @@ namespace Yavsc.Controllers { if (!ProductExists(id)) { - return HttpNotFound(); + return NotFound(); } else { @@ -79,7 +76,7 @@ namespace Yavsc.Controllers } } - return new HttpStatusCodeResult(StatusCodes.Status204NoContent); + return new StatusCodeResult(StatusCodes.Status204NoContent); } // POST: api/ProductApi @@ -88,7 +85,7 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } _context.Products.Add(product); @@ -100,7 +97,7 @@ namespace Yavsc.Controllers { if (ProductExists(product.Id)) { - return new HttpStatusCodeResult(StatusCodes.Status409Conflict); + return new StatusCodeResult(StatusCodes.Status409Conflict); } else { @@ -117,13 +114,13 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } Product product = _context.Products.Single(m => m.Id == id); if (product == null) { - return HttpNotFound(); + return NotFound(); } _context.Products.Remove(product); diff --git a/src/Yavsc/ApiControllers/DimissClicksApiController.cs b/src/Yavsc/ApiControllers/DimissClicksApiController.cs index e64ed7b2..2917da6d 100644 --- a/src/Yavsc/ApiControllers/DimissClicksApiController.cs +++ b/src/Yavsc/ApiControllers/DimissClicksApiController.cs @@ -1,11 +1,8 @@ -using System.Collections.Generic; -using System.Linq; using System.Security.Claims; -using System.Threading.Tasks; -using Microsoft.AspNet.Authorization; -using Microsoft.AspNet.Http; -using Microsoft.AspNet.Mvc; -using Microsoft.Data.Entity; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; +using Yavsc.Helpers; using Yavsc.Models; using Yavsc.Models.Messaging; @@ -26,7 +23,7 @@ namespace Yavsc.Controllers [HttpGet] public IEnumerable GetDimissClicked() { - var uid = User.GetUserId(); + var uid = User.FindFirstValue(ClaimTypes.NameIdentifier); return _context.DimissClicked.Where(d=>d.UserId == uid); } @@ -47,19 +44,19 @@ namespace Yavsc.Controllers [HttpGet("{id}", Name = "GetDimissClicked")] public async Task GetDimissClicked([FromRoute] string id) { - var uid = User.GetUserId(); + var uid = User.FindFirstValue(ClaimTypes.NameIdentifier); if (uid != id) return new ChallengeResult(); if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } DimissClicked dimissClicked = await _context.DimissClicked.SingleAsync(m => m.UserId == id); if (dimissClicked == null) { - return HttpNotFound(); + return NotFound(); } return Ok(dimissClicked); @@ -69,17 +66,17 @@ namespace Yavsc.Controllers [HttpPut("{id}")] public async Task PutDimissClicked([FromRoute] string id, [FromBody] DimissClicked dimissClicked) { - var uid = User.GetUserId(); + var uid = User.FindFirstValue(ClaimTypes.NameIdentifier); if (uid != id || uid != dimissClicked.UserId) return new ChallengeResult(); if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } if (id != dimissClicked.UserId) { - return HttpBadRequest(); + return BadRequest(); } _context.Entry(dimissClicked).State = EntityState.Modified; @@ -92,7 +89,7 @@ namespace Yavsc.Controllers { if (!DimissClickedExists(id)) { - return HttpNotFound(); + return NotFound(); } else { @@ -100,19 +97,19 @@ namespace Yavsc.Controllers } } - return new HttpStatusCodeResult(StatusCodes.Status204NoContent); + return new StatusCodeResult(StatusCodes.Status204NoContent); } // POST: api/DimissClicksApi [HttpPost] public async Task PostDimissClicked([FromBody] DimissClicked dimissClicked) { - var uid = User.GetUserId(); + var uid = User.FindFirstValue(ClaimTypes.NameIdentifier); if (uid != dimissClicked.UserId) return new ChallengeResult(); if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } _context.DimissClicked.Add(dimissClicked); @@ -124,7 +121,7 @@ namespace Yavsc.Controllers { if (DimissClickedExists(dimissClicked.UserId)) { - return new HttpStatusCodeResult(StatusCodes.Status409Conflict); + return new StatusCodeResult(StatusCodes.Status409Conflict); } else { @@ -139,19 +136,19 @@ namespace Yavsc.Controllers [HttpDelete("{id}")] public async Task DeleteDimissClicked([FromRoute] string id) { - var uid = User.GetUserId(); + var uid = User.FindFirstValue(ClaimTypes.NameIdentifier); if (!User.IsInRole("Administrator")) if (uid != id) return new ChallengeResult(); if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } DimissClicked dimissClicked = await _context.DimissClicked.SingleAsync(m => m.UserId == id); if (dimissClicked == null) { - return HttpNotFound(); + return NotFound(); } _context.DimissClicked.Remove(dimissClicked); diff --git a/src/Yavsc/ApiControllers/HairCut/BursherProfilesApiController.cs b/src/Yavsc/ApiControllers/HairCut/BursherProfilesApiController.cs index a0d98f0b..a29ae74a 100644 --- a/src/Yavsc/ApiControllers/HairCut/BursherProfilesApiController.cs +++ b/src/Yavsc/ApiControllers/HairCut/BursherProfilesApiController.cs @@ -1,10 +1,6 @@ -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using System.Security.Claims; -using Microsoft.AspNet.Http; -using Microsoft.AspNet.Mvc; -using Microsoft.Data.Entity; +using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; +using Yavsc.Helpers; using Yavsc.Models; using Yavsc.Models.Haircut; @@ -34,14 +30,14 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } BrusherProfile brusherProfile = await _context.BrusherProfile.SingleAsync(m => m.UserId == id); if (brusherProfile == null) { - return HttpNotFound(); + return NotFound(); } return Ok(brusherProfile); @@ -53,17 +49,17 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } if (id != brusherProfile.UserId) { - return HttpBadRequest(); + return BadRequest(); } if (id != User.GetUserId()) { - return HttpBadRequest(); + return BadRequest(); } _context.Entry(brusherProfile).State = EntityState.Modified; @@ -75,7 +71,7 @@ namespace Yavsc.Controllers { if (!BrusherProfileExists(id)) { - return HttpNotFound(); + return NotFound(); } else { @@ -83,7 +79,7 @@ namespace Yavsc.Controllers } } - return new HttpStatusCodeResult(StatusCodes.Status204NoContent); + return new StatusCodeResult(StatusCodes.Status204NoContent); } // POST: api/BursherProfilesApi @@ -92,7 +88,7 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } _context.BrusherProfile.Add(brusherProfile); @@ -104,7 +100,7 @@ namespace Yavsc.Controllers { if (BrusherProfileExists(brusherProfile.UserId)) { - return new HttpStatusCodeResult(StatusCodes.Status409Conflict); + return new StatusCodeResult(StatusCodes.Status409Conflict); } else { @@ -121,13 +117,13 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } BrusherProfile brusherProfile = await _context.BrusherProfile.SingleAsync(m => m.UserId == id); if (brusherProfile == null) { - return HttpNotFound(); + return NotFound(); } _context.BrusherProfile.Remove(brusherProfile); diff --git a/src/Yavsc/ApiControllers/HairCut/HairCutController.cs b/src/Yavsc/ApiControllers/HairCut/HairCutController.cs index 55dd3718..10dcb7f3 100644 --- a/src/Yavsc/ApiControllers/HairCut/HairCutController.cs +++ b/src/Yavsc/ApiControllers/HairCut/HairCutController.cs @@ -1,6 +1,5 @@ -using Microsoft.AspNet.Identity; -using Microsoft.AspNet.Mvc; -using Microsoft.Extensions.OptionsModel; +using Microsoft.AspNetCore.Identity; +using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Localization; @@ -16,14 +15,15 @@ namespace Yavsc.ApiControllers using Models.Haircut; using System.Threading.Tasks; using Helpers; - using Microsoft.Data.Entity; using Models.Payment; using Newtonsoft.Json; using PayPal.PayPalAPIInterfaceService.Model; using Yavsc.Models.Haircut.Views; - using Microsoft.AspNet.Http; + using Microsoft.AspNetCore.Http; + using Microsoft.EntityFrameworkCore; + using Microsoft.AspNetCore.Authorization; - [Route("api/haircut")] + [Route("api/haircut")][Authorize] public class HairCutController : Controller { private readonly ApplicationDbContext _context; @@ -40,7 +40,9 @@ namespace Yavsc.ApiControllers // user, as a client public IActionResult Index() { - var uid = User.GetUserId(); + + var uid = User.FindFirstValue(ClaimTypes.NameIdentifier); + var now = DateTime.Now; var result = _context.HairCutQueries .Include(q => q.Prestation) @@ -61,14 +63,14 @@ namespace Yavsc.ApiControllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } HairCutQuery hairCutQuery = await _context.HairCutQueries.SingleAsync(m => m.Id == id); if (hairCutQuery == null) { - return HttpNotFound(); + return NotFound(); } return Ok(hairCutQuery); @@ -80,12 +82,12 @@ namespace Yavsc.ApiControllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } if (id != hairCutQuery.Id) { - return HttpBadRequest(); + return BadRequest(); } _context.Entry(hairCutQuery).State = EntityState.Modified; @@ -98,7 +100,7 @@ namespace Yavsc.ApiControllers { if (!HairCutQueryExists(id)) { - return HttpNotFound(); + return NotFound(); } else { @@ -106,20 +108,20 @@ namespace Yavsc.ApiControllers } } - return new HttpStatusCodeResult(StatusCodes.Status204NoContent); + return new StatusCodeResult(StatusCodes.Status204NoContent); } [HttpPost] public async Task PostQuery(HairCutQuery hairCutQuery) { - var uid = User.GetUserId(); + var uid = User.FindFirstValue(ClaimTypes.NameIdentifier); if (!ModelState.IsValid) { return new BadRequestObjectResult(ModelState); } if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } _context.HairCutQueries.Add(hairCutQuery); @@ -131,7 +133,7 @@ namespace Yavsc.ApiControllers { if (HairCutQueryExists(hairCutQuery.Id)) { - return new HttpStatusCodeResult(StatusCodes.Status409Conflict); + return new StatusCodeResult(StatusCodes.Status409Conflict); } else { @@ -159,13 +161,13 @@ namespace Yavsc.ApiControllers } catch (Exception ex) { _logger.LogError(ex.Message); - return new HttpStatusCodeResult(500); + return new StatusCodeResult(500); } if (payment==null) { _logger.LogError("Error doing SetExpressCheckout, aborting."); _logger.LogError(JsonConvert.SerializeObject(Startup.PayPalSettings)); - return new HttpStatusCodeResult(500); + return new StatusCodeResult(500); } switch (payment.Ack) { @@ -195,13 +197,13 @@ namespace Yavsc.ApiControllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } HairCutQuery hairCutQuery = await _context.HairCutQueries.SingleAsync(m => m.Id == id); if (hairCutQuery == null) { - return HttpNotFound(); + return NotFound(); } _context.HairCutQueries.Remove(hairCutQuery); diff --git a/src/Yavsc/ApiControllers/HyperLinkApiController.cs b/src/Yavsc/ApiControllers/HyperLinkApiController.cs index 745042b3..b2d28baa 100644 --- a/src/Yavsc/ApiControllers/HyperLinkApiController.cs +++ b/src/Yavsc/ApiControllers/HyperLinkApiController.cs @@ -1,9 +1,5 @@ -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNet.Http; -using Microsoft.AspNet.Mvc; -using Microsoft.Data.Entity; +using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; using Yavsc.Models; using Yavsc.Models.Relationship; @@ -33,14 +29,14 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } HyperLink hyperLink = await _context.HyperLink.SingleAsync(m => m.HRef == id); if (hyperLink == null) { - return HttpNotFound(); + return NotFound(); } return Ok(hyperLink); @@ -52,12 +48,12 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } if (id != hyperLink.HRef) { - return HttpBadRequest(); + return BadRequest(); } _context.Entry(hyperLink).State = EntityState.Modified; @@ -70,7 +66,7 @@ namespace Yavsc.Controllers { if (!HyperLinkExists(id)) { - return HttpNotFound(); + return NotFound(); } else { @@ -78,7 +74,7 @@ namespace Yavsc.Controllers } } - return new HttpStatusCodeResult(StatusCodes.Status204NoContent); + return new StatusCodeResult(StatusCodes.Status204NoContent); } // POST: api/HyperLinkApi @@ -87,7 +83,7 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } _context.HyperLink.Add(hyperLink); @@ -99,7 +95,7 @@ namespace Yavsc.Controllers { if (HyperLinkExists(hyperLink.HRef)) { - return new HttpStatusCodeResult(StatusCodes.Status409Conflict); + return new StatusCodeResult(StatusCodes.Status409Conflict); } else { @@ -116,13 +112,13 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } HyperLink hyperLink = await _context.HyperLink.SingleAsync(m => m.HRef == id); if (hyperLink == null) { - return HttpNotFound(); + return NotFound(); } _context.HyperLink.Remove(hyperLink); diff --git a/src/Yavsc/ApiControllers/IT/GitRefsApiController.cs b/src/Yavsc/ApiControllers/IT/GitRefsApiController.cs index 88c6606d..55ae08b7 100644 --- a/src/Yavsc/ApiControllers/IT/GitRefsApiController.cs +++ b/src/Yavsc/ApiControllers/IT/GitRefsApiController.cs @@ -1,10 +1,6 @@ -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNet.Authorization; -using Microsoft.AspNet.Http; -using Microsoft.AspNet.Mvc; -using Microsoft.Data.Entity; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; using Yavsc.Models; using Yavsc.Server.Models.IT.SourceCode; @@ -35,14 +31,14 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } GitRepositoryReference gitRepositoryReference = await _context.GitRepositoryReference.SingleAsync(m => m.Id == id); if (gitRepositoryReference == null) { - return HttpNotFound(); + return NotFound(); } return Ok(gitRepositoryReference); @@ -54,7 +50,7 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } _context.Entry(gitRepositoryReference).State = EntityState.Modified; @@ -67,7 +63,7 @@ namespace Yavsc.Controllers { if (!GitRepositoryReferenceExists(id)) { - return HttpNotFound(); + return NotFound(); } else { @@ -75,7 +71,7 @@ namespace Yavsc.Controllers } } - return new HttpStatusCodeResult(StatusCodes.Status204NoContent); + return new StatusCodeResult(StatusCodes.Status204NoContent); } // POST: api/GitRefsApi @@ -84,7 +80,7 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } _context.GitRepositoryReference.Add(gitRepositoryReference); @@ -96,7 +92,7 @@ namespace Yavsc.Controllers { if (GitRepositoryReferenceExists(gitRepositoryReference.Id)) { - return new HttpStatusCodeResult(StatusCodes.Status409Conflict); + return new StatusCodeResult(StatusCodes.Status409Conflict); } else { @@ -113,13 +109,13 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } GitRepositoryReference gitRepositoryReference = await _context.GitRepositoryReference.SingleAsync(m => m.Id == id); if (gitRepositoryReference == null) { - return HttpNotFound(); + return NotFound(); } _context.GitRepositoryReference.Remove(gitRepositoryReference); @@ -142,4 +138,4 @@ namespace Yavsc.Controllers return _context.GitRepositoryReference.Count(e => e.Id == id) > 0; } } -} \ No newline at end of file +} diff --git a/src/Yavsc/ApiControllers/MailTemplatingApiController.cs b/src/Yavsc/ApiControllers/MailTemplatingApiController.cs index 56f948fd..958ade66 100644 --- a/src/Yavsc/ApiControllers/MailTemplatingApiController.cs +++ b/src/Yavsc/ApiControllers/MailTemplatingApiController.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNet.Mvc; +using Microsoft.AspNetCore.Mvc; namespace Yavsc.ApiControllers { diff --git a/src/Yavsc/ApiControllers/MailingTemplateApiController.cs b/src/Yavsc/ApiControllers/MailingTemplateApiController.cs index af41ba94..dc535476 100644 --- a/src/Yavsc/ApiControllers/MailingTemplateApiController.cs +++ b/src/Yavsc/ApiControllers/MailingTemplateApiController.cs @@ -1,13 +1,8 @@ -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNet.Http; -using Microsoft.AspNet.Mvc; -using Microsoft.Data.Entity; +using Microsoft.AspNetCore.Mvc; using Yavsc.Models; using Yavsc.Server.Models.EMailing; -using Microsoft.AspNet.Authorization; -using System.Security.Claims; +using Microsoft.AspNetCore.Authorization; +using Microsoft.EntityFrameworkCore; namespace Yavsc.Controllers { @@ -36,14 +31,14 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } MailingTemplate mailingTemplate = await _context.MailingTemplate.SingleAsync(m => m.Id == id); if (mailingTemplate == null) { - return HttpNotFound(); + return NotFound(); } return Ok(mailingTemplate); @@ -55,12 +50,12 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } if (id != mailingTemplate.Id) { - return HttpBadRequest(); + return BadRequest(); } _context.Entry(mailingTemplate).State = EntityState.Modified; @@ -73,7 +68,7 @@ namespace Yavsc.Controllers { if (!MailingTemplateExists(id)) { - return HttpNotFound(); + return NotFound(); } else { @@ -81,7 +76,7 @@ namespace Yavsc.Controllers } } - return new HttpStatusCodeResult(StatusCodes.Status204NoContent); + return new StatusCodeResult(StatusCodes.Status204NoContent); } // POST: api/MailingTemplateApi @@ -90,7 +85,7 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } _context.MailingTemplate.Add(mailingTemplate); @@ -102,7 +97,7 @@ namespace Yavsc.Controllers { if (MailingTemplateExists(mailingTemplate.Id)) { - return new HttpStatusCodeResult(StatusCodes.Status409Conflict); + return new StatusCodeResult(StatusCodes.Status409Conflict); } else { @@ -119,13 +114,13 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } MailingTemplate mailingTemplate = await _context.MailingTemplate.SingleAsync(m => m.Id == id); if (mailingTemplate == null) { - return HttpNotFound(); + return NotFound(); } _context.MailingTemplate.Remove(mailingTemplate); diff --git a/src/Yavsc/ApiControllers/Musical/MusicalPreferencesApiController.cs b/src/Yavsc/ApiControllers/Musical/MusicalPreferencesApiController.cs index 6730d5bf..a2d8c5bf 100644 --- a/src/Yavsc/ApiControllers/Musical/MusicalPreferencesApiController.cs +++ b/src/Yavsc/ApiControllers/Musical/MusicalPreferencesApiController.cs @@ -1,9 +1,6 @@ -using System.Collections.Generic; -using System.Linq; -using System.Security.Claims; -using Microsoft.AspNet.Http; -using Microsoft.AspNet.Mvc; -using Microsoft.Data.Entity; +using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; +using Yavsc.Helpers; using Yavsc.Models; using Yavsc.Models.Musical; @@ -33,14 +30,14 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } MusicalPreference musicalPreference = _context.MusicalPreference.Single(m => m.OwnerProfileId == id); if (musicalPreference == null) { - return HttpNotFound(); + return NotFound(); } return Ok(musicalPreference); @@ -51,12 +48,12 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } if (id != musicalPreference.OwnerProfileId) { - return HttpBadRequest(); + return BadRequest(); } _context.Entry(musicalPreference).State = EntityState.Modified; @@ -69,7 +66,7 @@ namespace Yavsc.Controllers { if (!MusicalPreferenceExists(id)) { - return HttpNotFound(); + return NotFound(); } else { @@ -77,7 +74,7 @@ namespace Yavsc.Controllers } } - return new HttpStatusCodeResult(StatusCodes.Status204NoContent); + return new StatusCodeResult(StatusCodes.Status204NoContent); } // POST: api/MusicalPreferencesApi @@ -86,7 +83,7 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } _context.MusicalPreference.Add(musicalPreference); @@ -98,7 +95,7 @@ namespace Yavsc.Controllers { if (MusicalPreferenceExists(musicalPreference.OwnerProfileId)) { - return new HttpStatusCodeResult(StatusCodes.Status409Conflict); + return new StatusCodeResult(StatusCodes.Status409Conflict); } else { @@ -115,13 +112,13 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } MusicalPreference musicalPreference = _context.MusicalPreference.Single(m => m.OwnerProfileId == id); if (musicalPreference == null) { - return HttpNotFound(); + return NotFound(); } _context.MusicalPreference.Remove(musicalPreference); diff --git a/src/Yavsc/ApiControllers/Musical/MusicalTendenciesApiController.cs b/src/Yavsc/ApiControllers/Musical/MusicalTendenciesApiController.cs index ac85b4cf..d9aedd14 100644 --- a/src/Yavsc/ApiControllers/Musical/MusicalTendenciesApiController.cs +++ b/src/Yavsc/ApiControllers/Musical/MusicalTendenciesApiController.cs @@ -1,9 +1,6 @@ -using System.Collections.Generic; -using System.Linq; -using System.Security.Claims; -using Microsoft.AspNet.Http; -using Microsoft.AspNet.Mvc; -using Microsoft.Data.Entity; +using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; +using Yavsc.Helpers; using Yavsc.Models; using Yavsc.Models.Musical; @@ -33,14 +30,14 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } MusicalTendency musicalTendency = _context.MusicalTendency.Single(m => m.Id == id); if (musicalTendency == null) { - return HttpNotFound(); + return NotFound(); } return Ok(musicalTendency); @@ -52,12 +49,12 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } if (id != musicalTendency.Id) { - return HttpBadRequest(); + return BadRequest(); } _context.Entry(musicalTendency).State = EntityState.Modified; @@ -70,7 +67,7 @@ namespace Yavsc.Controllers { if (!MusicalTendencyExists(id)) { - return HttpNotFound(); + return NotFound(); } else { @@ -78,7 +75,7 @@ namespace Yavsc.Controllers } } - return new HttpStatusCodeResult(StatusCodes.Status204NoContent); + return new StatusCodeResult(StatusCodes.Status204NoContent); } // POST: api/MusicalTendenciesApi @@ -87,7 +84,7 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } _context.MusicalTendency.Add(musicalTendency); @@ -99,7 +96,7 @@ namespace Yavsc.Controllers { if (MusicalTendencyExists(musicalTendency.Id)) { - return new HttpStatusCodeResult(StatusCodes.Status409Conflict); + return new StatusCodeResult(StatusCodes.Status409Conflict); } else { @@ -116,13 +113,13 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } MusicalTendency musicalTendency = _context.MusicalTendency.Single(m => m.Id == id); if (musicalTendency == null) { - return HttpNotFound(); + return NotFound(); } _context.MusicalTendency.Remove(musicalTendency); diff --git a/src/Yavsc/ApiControllers/Musical/PodcastController.cs b/src/Yavsc/ApiControllers/Musical/PodcastController.cs index 0c96e857..b4fc5bfb 100644 --- a/src/Yavsc/ApiControllers/Musical/PodcastController.cs +++ b/src/Yavsc/ApiControllers/Musical/PodcastController.cs @@ -1,8 +1,8 @@ -using Microsoft.AspNet.Mvc; +using Microsoft.AspNetCore.Mvc; namespace Yavsc.ApiControllers { public class PodcastController : Controller { } -} \ No newline at end of file +} diff --git a/src/Yavsc/ApiControllers/NativeConfidentialController.cs b/src/Yavsc/ApiControllers/NativeConfidentialController.cs index 2b273561..6adf68fd 100644 --- a/src/Yavsc/ApiControllers/NativeConfidentialController.cs +++ b/src/Yavsc/ApiControllers/NativeConfidentialController.cs @@ -2,9 +2,10 @@ using System; using System.Linq; using System.Security.Claims; -using Microsoft.AspNet.Authorization; -using Microsoft.AspNet.Mvc; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Logging; +using Yavsc.Helpers; using Yavsc.Models; using Yavsc.Models.Identity; @@ -30,7 +31,7 @@ public class NativeConfidentialController : Controller public IActionResult Register( [FromBody] DeviceDeclaration declaration) { - var uid = User.GetUserId(); + var uid = User.FindFirstValue(ClaimTypes.NameIdentifier); if (!ModelState.IsValid) { @@ -40,12 +41,15 @@ public class NativeConfidentialController : Controller declaration.LatestActivityUpdate = DateTime.Now; _logger.LogInformation($"Registering device with id:{declaration.DeviceId} for {uid}"); - var alreadyRegisteredDevice = _context.DeviceDeclaration.FirstOrDefault(d => d.DeviceId == declaration.DeviceId); + DeviceDeclaration? alreadyRegisteredDevice = _context.DeviceDeclaration.FirstOrDefault(d => d.DeviceId == declaration.DeviceId); var deviceAlreadyRegistered = (alreadyRegisteredDevice!=null); - if (deviceAlreadyRegistered) + if (alreadyRegisteredDevice==null) { - _logger.LogInformation($"deviceAlreadyRegistered"); - // Override an exiting owner + declaration.DeclarationDate = DateTime.Now; + declaration.DeviceOwnerId = uid; + _context.DeviceDeclaration.Add(declaration); + } + else { alreadyRegisteredDevice.DeviceOwnerId = uid; alreadyRegisteredDevice.Model = declaration.Model; alreadyRegisteredDevice.Platform = declaration.Platform; @@ -53,18 +57,13 @@ public class NativeConfidentialController : Controller _context.Update(alreadyRegisteredDevice); _context.SaveChanges(User.GetUserId()); } - else - { - _logger.LogInformation($"new device"); - declaration.DeclarationDate = DateTime.Now; - declaration.DeviceOwnerId = uid; - _context.DeviceDeclaration.Add(declaration as DeviceDeclaration); + _context.SaveChanges(User.GetUserId()); - } + var latestActivityUpdate = _context.Activities.Max(a=>a.DateModified); return Json(new { IsAnUpdate = deviceAlreadyRegistered, - UpdateActivities = (latestActivityUpdate != declaration.LatestActivityUpdate) + UpdateActivities = latestActivityUpdate != declaration.LatestActivityUpdate }); } diff --git a/src/Yavsc/ApiControllers/PostRateApiController.cs b/src/Yavsc/ApiControllers/PostRateApiController.cs index 5ee73234..25bb4341 100644 --- a/src/Yavsc/ApiControllers/PostRateApiController.cs +++ b/src/Yavsc/ApiControllers/PostRateApiController.cs @@ -1,7 +1,8 @@ using System.Linq; using System.Security.Claims; -using Microsoft.AspNet.Authorization; -using Microsoft.AspNet.Mvc; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Yavsc.Helpers; using Yavsc.Models; namespace Yavsc.Controllers @@ -23,20 +24,20 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } Models.Blog.BlogPost blogpost = _context.Blogspot.Single(x=>x.Id == id); if (blogpost == null) { - return HttpNotFound(); + return NotFound(); } - var uid = User.GetUserId(); + var uid = User.FindFirstValue(ClaimTypes.NameIdentifier); if (blogpost.AuthorId!=uid) if (!User.IsInRole(Constants.AdminGroupName)) - return HttpBadRequest(); + return BadRequest(); blogpost.Rate = rate; _context.SaveChanges(User.GetUserId()); diff --git a/src/Yavsc/ApiControllers/ProfileApiController.cs b/src/Yavsc/ApiControllers/ProfileApiController.cs index c854f7c5..60ad1f60 100644 --- a/src/Yavsc/ApiControllers/ProfileApiController.cs +++ b/src/Yavsc/ApiControllers/ProfileApiController.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNet.Mvc; +using Microsoft.AspNetCore.Mvc; namespace Yavsc.ApiControllers { diff --git a/src/Yavsc/ApiControllers/Relationship/BlackListApiController.cs b/src/Yavsc/ApiControllers/Relationship/BlackListApiController.cs index 5672932b..ced46b21 100644 --- a/src/Yavsc/ApiControllers/Relationship/BlackListApiController.cs +++ b/src/Yavsc/ApiControllers/Relationship/BlackListApiController.cs @@ -1,10 +1,8 @@ -using System.Collections.Generic; -using System.Linq; using System.Security.Claims; -using Microsoft.AspNet.Authorization; -using Microsoft.AspNet.Http; -using Microsoft.AspNet.Mvc; -using Microsoft.Data.Entity; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; +using Yavsc.Helpers; using Yavsc.Models; using Yavsc.Models.Access; @@ -34,22 +32,22 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } BlackListed blackListed = _context.BlackListed.Single(m => m.Id == id); if (blackListed == null) { - return HttpNotFound(); + return NotFound(); } if (!CheckPermission(blackListed)) - return HttpBadRequest(); + return BadRequest(); return Ok(blackListed); } private bool CheckPermission(BlackListed blackListed) { - var uid = User.GetUserId(); + var uid = User.FindFirstValue(ClaimTypes.NameIdentifier); if (uid != blackListed.OwnerId) if (!User.IsInRole(Constants.AdminGroupName)) if (!User.IsInRole(Constants.FrontOfficeGroupName)) @@ -62,15 +60,15 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } if (id != blackListed.Id) { - return HttpBadRequest(); + return BadRequest(); } if (!CheckPermission(blackListed)) - return HttpBadRequest(); + return BadRequest(); _context.Entry(blackListed).State = EntityState.Modified; try @@ -81,7 +79,7 @@ namespace Yavsc.Controllers { if (!BlackListedExists(id)) { - return HttpNotFound(); + return NotFound(); } else { @@ -89,7 +87,7 @@ namespace Yavsc.Controllers } } - return new HttpStatusCodeResult(StatusCodes.Status204NoContent); + return new StatusCodeResult(StatusCodes.Status204NoContent); } // POST: api/BlackListApi @@ -98,11 +96,11 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } if (!CheckPermission(blackListed)) - return HttpBadRequest(); + return BadRequest(); _context.BlackListed.Add(blackListed); try @@ -113,7 +111,7 @@ namespace Yavsc.Controllers { if (BlackListedExists(blackListed.Id)) { - return new HttpStatusCodeResult(StatusCodes.Status409Conflict); + return new StatusCodeResult(StatusCodes.Status409Conflict); } else { @@ -130,17 +128,17 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } BlackListed blackListed = _context.BlackListed.Single(m => m.Id == id); if (blackListed == null) { - return HttpNotFound(); + return NotFound(); } if (!CheckPermission(blackListed)) - return HttpBadRequest(); + return BadRequest(); _context.BlackListed.Remove(blackListed); _context.SaveChanges(User.GetUserId()); diff --git a/src/Yavsc/ApiControllers/Relationship/BlogAclApiController.cs b/src/Yavsc/ApiControllers/Relationship/BlogAclApiController.cs index e5ea753c..cf3f4150 100644 --- a/src/Yavsc/ApiControllers/Relationship/BlogAclApiController.cs +++ b/src/Yavsc/ApiControllers/Relationship/BlogAclApiController.cs @@ -1,10 +1,7 @@ -using System.Collections.Generic; -using System.Linq; using System.Security.Claims; -using System.Threading.Tasks; -using Microsoft.AspNet.Http; -using Microsoft.AspNet.Mvc; -using Microsoft.Data.Entity; +using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; +using Yavsc.Helpers; using Yavsc.Models; using Yavsc.Models.Access; @@ -34,15 +31,15 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } - var uid = User.GetUserId(); + var uid = User.FindFirstValue(ClaimTypes.NameIdentifier); CircleAuthorizationToBlogPost circleAuthorizationToBlogPost = await _context.CircleAuthorizationToBlogPost.SingleAsync( m => m.CircleId == id && m.Allowed.OwnerId == uid ); if (circleAuthorizationToBlogPost == null) { - return HttpNotFound(); + return NotFound(); } return Ok(circleAuthorizationToBlogPost); @@ -54,12 +51,12 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } if (id != circleAuthorizationToBlogPost.CircleId) { - return HttpBadRequest(); + return BadRequest(); } if (!CheckOwner(circleAuthorizationToBlogPost.CircleId)) @@ -76,7 +73,7 @@ namespace Yavsc.Controllers { if (!CircleAuthorizationToBlogPostExists(id)) { - return HttpNotFound(); + return NotFound(); } else { @@ -84,12 +81,12 @@ namespace Yavsc.Controllers } } - return new HttpStatusCodeResult(StatusCodes.Status204NoContent); + return new StatusCodeResult(StatusCodes.Status204NoContent); } private bool CheckOwner (long circleId) { - var uid = User.GetUserId(); + var uid = User.FindFirstValue(ClaimTypes.NameIdentifier); var circle = _context.Circle.First(c=>c.Id==circleId); _context.Entry(circle).State = EntityState.Detached; return (circle.OwnerId == uid); @@ -100,7 +97,7 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } if (!CheckOwner(circleAuthorizationToBlogPost.CircleId)) { @@ -115,7 +112,7 @@ namespace Yavsc.Controllers { if (CircleAuthorizationToBlogPostExists(circleAuthorizationToBlogPost.CircleId)) { - return new HttpStatusCodeResult(StatusCodes.Status409Conflict); + return new StatusCodeResult(StatusCodes.Status409Conflict); } else { @@ -132,9 +129,9 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } - var uid = User.GetUserId(); + var uid = User.FindFirstValue(ClaimTypes.NameIdentifier); CircleAuthorizationToBlogPost circleAuthorizationToBlogPost = await _context.CircleAuthorizationToBlogPost.Include( a=>a.Allowed @@ -142,7 +139,7 @@ namespace Yavsc.Controllers && m.Allowed.OwnerId == uid); if (circleAuthorizationToBlogPost == null) { - return HttpNotFound(); + return NotFound(); } _context.CircleAuthorizationToBlogPost.Remove(circleAuthorizationToBlogPost); await _context.SaveChangesAsync(User.GetUserId()); diff --git a/src/Yavsc/ApiControllers/Relationship/ChatApiController.cs b/src/Yavsc/ApiControllers/Relationship/ChatApiController.cs index a806251d..cdaeecde 100644 --- a/src/Yavsc/ApiControllers/Relationship/ChatApiController.cs +++ b/src/Yavsc/ApiControllers/Relationship/ChatApiController.cs @@ -1,13 +1,10 @@ - -using System.Collections.Generic; -using System.Linq; -using Microsoft.Data.Entity; using System.Security.Claims; -using Microsoft.AspNet.Mvc; -using Microsoft.AspNet.Identity; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Identity; using Yavsc.Models; using Yavsc.ViewModels.Chat; using Yavsc.Services; +using Microsoft.EntityFrameworkCore; namespace Yavsc.Controllers { @@ -72,12 +69,12 @@ namespace Yavsc.Controllers if (!ModelState.IsValid) // Miguel mech profiler { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } - var uid = User.GetUserId(); + var uid = User.FindFirstValue(ClaimTypes.NameIdentifier); var user = dbContext.ApplicationUser.Include(u => u.Connections).FirstOrDefault(u => u.UserName == userName); - if (user == null) return HttpNotFound(); + if (user == null) return NotFound(); return Ok(new ChatUserInfo { diff --git a/src/Yavsc/ApiControllers/Relationship/ChatRoomAccessApiController.cs b/src/Yavsc/ApiControllers/Relationship/ChatRoomAccessApiController.cs index 1eb49ee2..4748f7ec 100644 --- a/src/Yavsc/ApiControllers/Relationship/ChatRoomAccessApiController.cs +++ b/src/Yavsc/ApiControllers/Relationship/ChatRoomAccessApiController.cs @@ -1,11 +1,7 @@ -using System.Collections.Generic; -using System.Linq; using System.Security.Claims; -using System.Threading.Tasks; -using Microsoft.AspNet.Authorization; -using Microsoft.AspNet.Http; -using Microsoft.AspNet.Mvc; -using Microsoft.Data.Entity; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; using Yavsc.Models; using Yavsc.Models.Chat; @@ -35,7 +31,7 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } ChatRoomAccess chatRoomAccess = await _context.ChatRoomAccess.SingleAsync(m => m.ChannelName == id); @@ -44,16 +40,16 @@ namespace Yavsc.Controllers if (chatRoomAccess == null) { - return HttpNotFound(); + return NotFound(); } - var uid = User.GetUserId(); + var uid = User.FindFirstValue(ClaimTypes.NameIdentifier); if (uid != chatRoomAccess.UserId && uid != chatRoomAccess.Room.OwnerId && ! User.IsInRole(Constants.AdminGroupName)) { ModelState.AddModelError("UserId","get refused"); - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } return Ok(chatRoomAccess); @@ -65,20 +61,20 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } - var uid = User.GetUserId(); + var uid = User.FindFirstValue(ClaimTypes.NameIdentifier); if (id != chatRoomAccess.ChannelName) { - return HttpBadRequest(); + return BadRequest(); } var room = _context.ChatRoom.First(channel => channel.Name == chatRoomAccess.ChannelName ); if (uid != room.OwnerId && ! User.IsInRole(Constants.AdminGroupName)) { ModelState.AddModelError("ChannelName", "access put refused"); - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } _context.Entry(chatRoomAccess).State = EntityState.Modified; @@ -91,7 +87,7 @@ namespace Yavsc.Controllers { if (!ChatRoomAccessExists(id)) { - return HttpNotFound(); + return NotFound(); } else { @@ -99,7 +95,7 @@ namespace Yavsc.Controllers } } - return new HttpStatusCodeResult(StatusCodes.Status204NoContent); + return new StatusCodeResult(StatusCodes.Status204NoContent); } // POST: api/ChatRoomAccessApi @@ -108,15 +104,15 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } - var uid = User.GetUserId(); + var uid = User.FindFirstValue(ClaimTypes.NameIdentifier); var room = _context.ChatRoom.First(channel => channel.Name == chatRoomAccess.ChannelName ); if (room == null || (uid != room.OwnerId && ! User.IsInRole(Constants.AdminGroupName))) { ModelState.AddModelError("ChannelName", "access post refused"); - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } _context.ChatRoomAccess.Add(chatRoomAccess); @@ -129,7 +125,7 @@ namespace Yavsc.Controllers { if (ChatRoomAccessExists(chatRoomAccess.ChannelName)) { - return new HttpStatusCodeResult(StatusCodes.Status409Conflict); + return new StatusCodeResult(StatusCodes.Status409Conflict); } else { @@ -146,21 +142,21 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } ChatRoomAccess chatRoomAccess = await _context.ChatRoomAccess.Include(acc => acc.Room).SingleAsync(m => m.ChannelName == id); if (chatRoomAccess == null) { - return HttpNotFound(); + return NotFound(); } - var uid = User.GetUserId(); + var uid = User.FindFirstValue(ClaimTypes.NameIdentifier); var room = _context.ChatRoom.First(channel => channel.Name == chatRoomAccess.ChannelName ); if (room == null || (uid != room.OwnerId && chatRoomAccess.UserId != uid && ! User.IsInRole(Constants.AdminGroupName))) { ModelState.AddModelError("UserId", "access drop refused"); - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } _context.ChatRoomAccess.Remove(chatRoomAccess); diff --git a/src/Yavsc/ApiControllers/Relationship/ChatRoomApiController.cs b/src/Yavsc/ApiControllers/Relationship/ChatRoomApiController.cs index 3add911f..9eee40ff 100644 --- a/src/Yavsc/ApiControllers/Relationship/ChatRoomApiController.cs +++ b/src/Yavsc/ApiControllers/Relationship/ChatRoomApiController.cs @@ -1,10 +1,6 @@ -using System.Collections.Generic; -using System.Linq; -using System.Security.Claims; -using System.Threading.Tasks; -using Microsoft.AspNet.Http; -using Microsoft.AspNet.Mvc; -using Microsoft.Data.Entity; +using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; +using Yavsc.Helpers; using Yavsc.Models; using Yavsc.Models.Chat; @@ -34,14 +30,14 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } ChatRoom chatRoom = await _context.ChatRoom.SingleAsync(m => m.Name == id); if (chatRoom == null) { - return HttpNotFound(); + return NotFound(); } return Ok(chatRoom); @@ -53,17 +49,17 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } if (id != chatRoom.Name) { - return HttpBadRequest(); + return BadRequest(); } if (User.GetUserId() != chatRoom.OwnerId ) { - return HttpBadRequest(new {error = "OwnerId"}); + return BadRequest(new {error = "OwnerId"}); } _context.Entry(chatRoom).State = EntityState.Modified; @@ -76,7 +72,7 @@ namespace Yavsc.Controllers { if (!ChatRoomExists(id)) { - return HttpNotFound(); + return NotFound(); } else { @@ -84,7 +80,7 @@ namespace Yavsc.Controllers } } - return new HttpStatusCodeResult(StatusCodes.Status204NoContent); + return new StatusCodeResult(StatusCodes.Status204NoContent); } // POST: api/ChatRoomApi @@ -93,12 +89,12 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } if (User.GetUserId() != chatRoom.OwnerId ) { - return HttpBadRequest(new {error = "OwnerId"}); + return BadRequest(new {error = "OwnerId"}); } _context.ChatRoom.Add(chatRoom); @@ -110,7 +106,7 @@ namespace Yavsc.Controllers { if (ChatRoomExists(chatRoom.Name)) { - return new HttpStatusCodeResult(StatusCodes.Status409Conflict); + return new StatusCodeResult(StatusCodes.Status409Conflict); } else { @@ -127,7 +123,7 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } ChatRoom chatRoom = await _context.ChatRoom.SingleAsync(m => m.Name == id); @@ -135,13 +131,13 @@ namespace Yavsc.Controllers if (chatRoom == null) { - return HttpNotFound(); + return NotFound(); } if (User.GetUserId() != chatRoom.OwnerId ) { if (!User.IsInRole(Constants.AdminGroupName)) - return HttpBadRequest(new {error = "OwnerId"}); + return BadRequest(new {error = "OwnerId"}); } _context.ChatRoom.Remove(chatRoom); diff --git a/src/Yavsc/ApiControllers/Relationship/CircleApiController.cs b/src/Yavsc/ApiControllers/Relationship/CircleApiController.cs index 1e19d036..7c3a85a0 100644 --- a/src/Yavsc/ApiControllers/Relationship/CircleApiController.cs +++ b/src/Yavsc/ApiControllers/Relationship/CircleApiController.cs @@ -1,10 +1,6 @@ -using System.Collections.Generic; -using System.Linq; -using System.Security.Claims; -using System.Threading.Tasks; -using Microsoft.AspNet.Http; -using Microsoft.AspNet.Mvc; -using Microsoft.Data.Entity; +using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; +using Yavsc.Helpers; using Yavsc.Models; using Yavsc.Models.Relationship; @@ -34,14 +30,14 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } Circle circle = await _context.Circle.SingleAsync(m => m.Id == id); if (circle == null) { - return HttpNotFound(); + return NotFound(); } return Ok(circle); @@ -53,12 +49,12 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } if (id != circle.Id) { - return HttpBadRequest(); + return BadRequest(); } _context.Entry(circle).State = EntityState.Modified; @@ -71,7 +67,7 @@ namespace Yavsc.Controllers { if (!CircleExists(id)) { - return HttpNotFound(); + return NotFound(); } else { @@ -79,7 +75,7 @@ namespace Yavsc.Controllers } } - return new HttpStatusCodeResult(StatusCodes.Status204NoContent); + return new StatusCodeResult(StatusCodes.Status204NoContent); } // POST: api/CircleApi @@ -88,7 +84,7 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } _context.Circle.Add(circle); @@ -100,7 +96,7 @@ namespace Yavsc.Controllers { if (CircleExists(circle.Id)) { - return new HttpStatusCodeResult(StatusCodes.Status409Conflict); + return new StatusCodeResult(StatusCodes.Status409Conflict); } else { @@ -117,13 +113,13 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } Circle circle = await _context.Circle.SingleAsync(m => m.Id == id); if (circle == null) { - return HttpNotFound(); + return NotFound(); } _context.Circle.Remove(circle); diff --git a/src/Yavsc/ApiControllers/Relationship/ContactsApiController.cs b/src/Yavsc/ApiControllers/Relationship/ContactsApiController.cs index a17f2a14..2da02e46 100644 --- a/src/Yavsc/ApiControllers/Relationship/ContactsApiController.cs +++ b/src/Yavsc/ApiControllers/Relationship/ContactsApiController.cs @@ -1,9 +1,7 @@ -using System.Linq; -using System.Security.Claims; -using Microsoft.AspNet.Http; -using Microsoft.AspNet.Mvc; -using Microsoft.Data.Entity; +using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; using Yavsc.Abstract.Identity; +using Yavsc.Helpers; using Yavsc.Models; namespace Yavsc.Controllers @@ -32,12 +30,12 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } if (id != clientProviderInfo.UserId) { - return HttpBadRequest(); + return BadRequest(); } _context.Entry(clientProviderInfo).State = EntityState.Modified; @@ -50,7 +48,7 @@ namespace Yavsc.Controllers { if (!ClientProviderInfoExists(id)) { - return HttpNotFound(); + return NotFound(); } else { @@ -58,7 +56,7 @@ namespace Yavsc.Controllers } } - return new HttpStatusCodeResult(StatusCodes.Status204NoContent); + return new StatusCodeResult(StatusCodes.Status204NoContent); } // POST: api/ContactsApi @@ -67,7 +65,7 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } _context.ClientProviderInfo.Add(clientProviderInfo); @@ -79,7 +77,7 @@ namespace Yavsc.Controllers { if (ClientProviderInfoExists(clientProviderInfo.UserId)) { - return new HttpStatusCodeResult(StatusCodes.Status409Conflict); + return new StatusCodeResult(StatusCodes.Status409Conflict); } else { @@ -96,13 +94,13 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } ClientProviderInfo clientProviderInfo = _context.ClientProviderInfo.Single(m => m.UserId == id); if (clientProviderInfo == null) { - return HttpNotFound(); + return NotFound(); } _context.ClientProviderInfo.Remove(clientProviderInfo); diff --git a/src/Yavsc/ApiControllers/ServiceApiController.cs b/src/Yavsc/ApiControllers/ServiceApiController.cs index 8958e050..cb612b34 100644 --- a/src/Yavsc/ApiControllers/ServiceApiController.cs +++ b/src/Yavsc/ApiControllers/ServiceApiController.cs @@ -1,10 +1,7 @@ -using System.Collections.Generic; -using System.Linq; -using System.Security.Claims; -using Microsoft.AspNet.Authorization; -using Microsoft.AspNet.Http; -using Microsoft.AspNet.Mvc; -using Microsoft.Data.Entity; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; +using Yavsc.Helpers; using Yavsc.Models; using Yavsc.Models.Market; @@ -34,14 +31,14 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } Service service = _context.Services.Single(m => m.Id == id); if (service == null) { - return HttpNotFound(); + return NotFound(); } return Ok(service); @@ -53,12 +50,12 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } if (id != service.Id) { - return HttpBadRequest(); + return BadRequest(); } _context.Entry(service).State = EntityState.Modified; @@ -71,7 +68,7 @@ namespace Yavsc.Controllers { if (!ServiceExists(id)) { - return HttpNotFound(); + return NotFound(); } else { @@ -79,7 +76,7 @@ namespace Yavsc.Controllers } } - return new HttpStatusCodeResult(StatusCodes.Status204NoContent); + return new StatusCodeResult(StatusCodes.Status204NoContent); } // POST: api/ServiceApi @@ -88,7 +85,7 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } _context.Services.Add(service); @@ -100,7 +97,7 @@ namespace Yavsc.Controllers { if (ServiceExists(service.Id)) { - return new HttpStatusCodeResult(StatusCodes.Status409Conflict); + return new StatusCodeResult(StatusCodes.Status409Conflict); } else { @@ -117,13 +114,13 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } Service service = _context.Services.Single(m => m.Id == id); if (service == null) { - return HttpNotFound(); + return NotFound(); } _context.Services.Remove(service); diff --git a/src/Yavsc/ApiControllers/Survey/BugApiController.cs b/src/Yavsc/ApiControllers/Survey/BugApiController.cs index 153980da..a28ed8df 100644 --- a/src/Yavsc/ApiControllers/Survey/BugApiController.cs +++ b/src/Yavsc/ApiControllers/Survey/BugApiController.cs @@ -1,14 +1,9 @@ using Newtonsoft.Json; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNet.Http; -using Microsoft.AspNet.Mvc; -using Microsoft.AspNet.Authorization; -using Microsoft.Data.Entity; -using Microsoft.Extensions.Logging; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Authorization; using Yavsc.Models; using Yavsc.Models.IT.Fixing; +using Microsoft.EntityFrameworkCore; namespace Yavsc.ApiControllers { @@ -73,14 +68,14 @@ namespace Yavsc.ApiControllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } Bug bug = await _context.Bug.SingleAsync(m => m.Id == id); if (bug == null) { - return HttpNotFound(); + return NotFound(); } return Ok(bug); @@ -92,12 +87,12 @@ namespace Yavsc.ApiControllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } if (id != bug.Id) { - return HttpBadRequest(); + return BadRequest(); } _context.Entry(bug).State = EntityState.Modified; @@ -110,7 +105,7 @@ namespace Yavsc.ApiControllers { if (!BugExists(id)) { - return HttpNotFound(); + return NotFound(); } else { @@ -118,7 +113,7 @@ namespace Yavsc.ApiControllers } } - return new HttpStatusCodeResult(StatusCodes.Status204NoContent); + return new StatusCodeResult(StatusCodes.Status204NoContent); } // POST: api/bug @@ -127,7 +122,7 @@ namespace Yavsc.ApiControllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } _context.Bug.Add(bug); @@ -139,7 +134,7 @@ namespace Yavsc.ApiControllers { if (BugExists(bug.Id)) { - return new HttpStatusCodeResult(StatusCodes.Status409Conflict); + return new StatusCodeResult(StatusCodes.Status409Conflict); } else { @@ -156,13 +151,13 @@ namespace Yavsc.ApiControllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } Bug bug = await _context.Bug.SingleAsync(m => m.Id == id); if (bug == null) { - return HttpNotFound(); + return NotFound(); } _context.Bug.Remove(bug); diff --git a/src/Yavsc/ApiControllers/accounting/AccountController.cs b/src/Yavsc/ApiControllers/accounting/AccountController.cs index 5d1fc6e3..f3c58e36 100644 --- a/src/Yavsc/ApiControllers/accounting/AccountController.cs +++ b/src/Yavsc/ApiControllers/accounting/AccountController.cs @@ -1,6 +1,6 @@ -using Microsoft.AspNet.Identity; -using Microsoft.AspNet.Authorization; -using Microsoft.AspNet.Mvc; +using Microsoft.AspNetCore.Identity; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Logging; using System.Security.Claims; using System.Threading.Tasks; @@ -12,9 +12,8 @@ namespace Yavsc.WebApi.Controllers using ViewModels.Account; using Yavsc.Helpers; using System.Linq; - using Microsoft.Data.Entity; - using Microsoft.AspNet.Identity.EntityFramework; using Yavsc.Abstract.Identity; + using Microsoft.EntityFrameworkCore; [Authorize(),Route("~/api/account")] public class ApiAccountController : Controller @@ -132,12 +131,11 @@ namespace Yavsc.WebApi.Controllers if (User==null) return new BadRequestObjectResult( new { error = "user not found" }); - var uid = User.GetUserId(); + var uid = User.FindFirstValue(ClaimTypes.NameIdentifier); var userData = await _dbContext.Users .Include(u=>u.PostalAddress) .Include(u=>u.AccountBalance) - .Include(u=>u.Roles) .FirstAsync(u=>u.Id == uid); var user = new Yavsc.Models.Auth.Me(userData.Id, userData.UserName, userData.Email, diff --git a/src/Yavsc/ApiControllers/accounting/ApplicationUserApiController.cs b/src/Yavsc/ApiControllers/accounting/ApplicationUserApiController.cs index b46e751b..02638ca3 100644 --- a/src/Yavsc/ApiControllers/accounting/ApplicationUserApiController.cs +++ b/src/Yavsc/ApiControllers/accounting/ApplicationUserApiController.cs @@ -1,11 +1,12 @@ using System.Collections.Generic; using System.Linq; using System.Security.Claims; -using Microsoft.AspNet.Authorization; -using Microsoft.AspNet.Http; -using Microsoft.AspNet.Mvc; -using Microsoft.Data.Entity; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; using Yavsc.Abstract.Identity; +using Yavsc.Helpers; using Yavsc.Models; namespace Yavsc.Controllers @@ -49,14 +50,14 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } - ApplicationUser applicationUser = _context.Users.Include(u=>u.Roles).Include(u=>u.Logins).Include(u=>u.Claims).Single(m => m.Id == id); + ApplicationUser applicationUser = _context.Users.Single(m => m.Id == id); if (applicationUser == null) { - return HttpNotFound(); + return NotFound(); } return Ok(applicationUser); @@ -68,12 +69,12 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } if (id != applicationUser.Id) { - return HttpBadRequest(); + return BadRequest(); } _context.Entry(applicationUser).State = EntityState.Modified; @@ -86,7 +87,7 @@ namespace Yavsc.Controllers { if (!ApplicationUserExists(id)) { - return HttpNotFound(); + return NotFound(); } else { @@ -94,7 +95,7 @@ namespace Yavsc.Controllers } } - return new HttpStatusCodeResult(StatusCodes.Status204NoContent); + return new StatusCodeResult(StatusCodes.Status204NoContent); } // POST: api/ApplicationUserApi @@ -103,7 +104,7 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } _context.Users.Add(applicationUser); @@ -115,7 +116,7 @@ namespace Yavsc.Controllers { if (ApplicationUserExists(applicationUser.Id)) { - return new HttpStatusCodeResult(StatusCodes.Status409Conflict); + return new StatusCodeResult(StatusCodes.Status409Conflict); } else { @@ -132,13 +133,13 @@ namespace Yavsc.Controllers { if (!ModelState.IsValid) { - return HttpBadRequest(ModelState); + return BadRequest(ModelState); } ApplicationUser applicationUser = _context.Users.Single(m => m.Id == id); if (applicationUser == null) { - return HttpNotFound(); + return NotFound(); } _context.Users.Remove(applicationUser); diff --git a/src/Yavsc/ApiControllers/accounting/ProfileApiController.cs b/src/Yavsc/ApiControllers/accounting/ProfileApiController.cs index 01e74265..16e1425f 100644 --- a/src/Yavsc/ApiControllers/accounting/ProfileApiController.cs +++ b/src/Yavsc/ApiControllers/accounting/ProfileApiController.cs @@ -1,10 +1,11 @@ -using Microsoft.AspNet.Identity; -using Microsoft.AspNet.Mvc; +using Microsoft.AspNetCore.Identity; +using Microsoft.AspNetCore.Mvc; using System.Security.Claims; using System.Threading.Tasks; using System.Linq; using Yavsc.Models; using Yavsc.Abstract.Identity; +using Yavsc.Helpers; namespace Yavsc.ApiControllers.accounting { diff --git a/src/Yavsc/AuthorizationHandlers/AnnouceEditHandler.cs b/src/Yavsc/AuthorizationHandlers/AnnouceEditHandler.cs deleted file mode 100644 index ae757684..00000000 --- a/src/Yavsc/AuthorizationHandlers/AnnouceEditHandler.cs +++ /dev/null @@ -1,23 +0,0 @@ - - -using System.Security.Claims; -using Microsoft.AspNet.Authorization; -using Yavsc.Interfaces; -using Yavsc.ViewModels.Auth; - -namespace Yavsc.AuthorizationHandlers -{ - public class AnnouceEditHandler : AuthorizationHandler - { - protected override void Handle(AuthorizationContext context, EditRequirement requirement, - IOwned resource) - { - if (context.User.IsInRole(Constants.BlogModeratorGroupName) - || context.User.IsInRole(Constants.AdminGroupName)) - context.Succeed(requirement); - if (resource.OwnerId == context.User.GetUserId()) - context.Succeed(requirement); - } - - } -} diff --git a/src/Yavsc/AuthorizationHandlers/BillEditHandler.cs b/src/Yavsc/AuthorizationHandlers/BillEditHandler.cs deleted file mode 100644 index c69337dc..00000000 --- a/src/Yavsc/AuthorizationHandlers/BillEditHandler.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System.Security.Claims; -using Microsoft.AspNet.Authorization; -using Yavsc.ViewModels.Auth; - -namespace Yavsc.AuthorizationHandlers -{ - using Billing; - public class BillEditHandler : AuthorizationHandler - { - protected override void Handle(AuthorizationContext context, EditRequirement requirement, IBillable resource) - { - - if (context.User.IsInRole("FrontOffice")) - context.Succeed(requirement); - else if (context.User.Identity.IsAuthenticated) - if (resource.ClientId == context.User.GetUserId()) - context.Succeed(requirement); - } - - } -} \ No newline at end of file diff --git a/src/Yavsc/AuthorizationHandlers/BillViewHandlers.cs b/src/Yavsc/AuthorizationHandlers/BillViewHandlers.cs deleted file mode 100644 index 1e204a46..00000000 --- a/src/Yavsc/AuthorizationHandlers/BillViewHandlers.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System.Security.Claims; -using Microsoft.AspNet.Authorization; -using Yavsc.ViewModels.Auth; - -namespace Yavsc.AuthorizationHandlers -{ - using Billing; - - public class BillViewHandler : AuthorizationHandler - { - protected override void Handle(AuthorizationContext context, ViewRequirement requirement, IBillable resource) - { - if (context.User.IsInRole("FrontOffice")) - context.Succeed(requirement); - else if (context.User.Identity.IsAuthenticated) - if (resource.ClientId == context.User.GetUserId()) - context.Succeed(requirement); - else if (resource.PerformerId == context.User.GetUserId()) - context.Succeed(requirement); - } - - } -} \ No newline at end of file diff --git a/src/Yavsc/AuthorizationHandlers/BlogEditHandler.cs b/src/Yavsc/AuthorizationHandlers/BlogEditHandler.cs deleted file mode 100644 index 46753a2e..00000000 --- a/src/Yavsc/AuthorizationHandlers/BlogEditHandler.cs +++ /dev/null @@ -1,20 +0,0 @@ -using Microsoft.AspNet.Authorization; -using System.Security.Claims; -using Yavsc.Models.Blog; -using Yavsc.ViewModels.Auth; - -namespace Yavsc.AuthorizationHandlers -{ - public class BlogEditHandler : AuthorizationHandler - { - protected override void Handle(AuthorizationContext context, EditRequirement requirement, BlogPost resource) - { - if (context.User.IsInRole(Constants.BlogModeratorGroupName)) - context.Succeed(requirement); - else if (context.User.Identity.IsAuthenticated) - if (resource.AuthorId == context.User.GetUserId()) - context.Succeed(requirement); - } - - } -} \ No newline at end of file diff --git a/src/Yavsc/AuthorizationHandlers/BlogViewHandler.cs b/src/Yavsc/AuthorizationHandlers/BlogViewHandler.cs deleted file mode 100644 index 97453e58..00000000 --- a/src/Yavsc/AuthorizationHandlers/BlogViewHandler.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Linq; -using System.Security.Claims; -using Microsoft.AspNet.Authorization; -using Yavsc.Models.Blog; -using Yavsc.ViewModels.Auth; - -namespace Yavsc.AuthorizationHandlers -{ - public class BlogViewHandler : AuthorizationHandler - { - protected override void Handle(AuthorizationContext context, ViewRequirement requirement, BlogPost resource) - { - bool ok=false; - if (resource.Visible) { - if (resource.ACL==null) - ok=true; - else if (resource.ACL.Count==0) ok=true; - else { - if (context.User.IsSignedIn()) { - var uid = context.User.GetUserId(); - if (resource.ACL.Any(a=>a.Allowed!=null && a.Allowed.Members.Any(m=>m.MemberId == uid ))) - ok=true; - } - } - } - if (ok) context.Succeed(requirement); - else { - if (context.User.IsInRole(Constants.AdminGroupName) || - context.User.IsInRole(Constants.BlogModeratorGroupName)) - context.Succeed(requirement); - else context.Fail(); - } - } - } -} diff --git a/src/Yavsc/AuthorizationHandlers/HasBadgeHandler.cs b/src/Yavsc/AuthorizationHandlers/HasBadgeHandler.cs deleted file mode 100644 index 79a03f5e..00000000 --- a/src/Yavsc/AuthorizationHandlers/HasBadgeHandler.cs +++ /dev/null @@ -1,18 +0,0 @@ -using Microsoft.AspNet.Authorization; -using Yavsc.ViewModels.Auth; - -namespace Yavsc.AuthorizationHandlers -{ - public class HasBadgeHandler : AuthorizationHandler - { - protected override void Handle(AuthorizationContext context, PrivateChatEntryRequirement requirement) - { - if (!context.User.HasClaim(c => c.Type == "BadgeNumber" && - c.Issuer == Startup.Authority)) - { - return; - } - context.Succeed(requirement); - } - } -} \ No newline at end of file diff --git a/src/Yavsc/AuthorizationHandlers/HasTemporaryPassHandler.cs b/src/Yavsc/AuthorizationHandlers/HasTemporaryPassHandler.cs deleted file mode 100644 index 6b649e37..00000000 --- a/src/Yavsc/AuthorizationHandlers/HasTemporaryPassHandler.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System; -using Microsoft.AspNet.Authorization; -using Yavsc.ViewModels.Auth; - -namespace Yavsc.AuthorizationHandlers -{ - public class HasTemporaryPassHandler : AuthorizationHandler - { - protected override void Handle(AuthorizationContext context, PrivateChatEntryRequirement requirement) - { - if (!context.User.HasClaim(c => c.Type == "TemporaryBadgeExpiry" && - c.Issuer == Startup.Authority)) - { - return; - } - - var temporaryBadgeExpiry = - Convert.ToDateTime(context.User.FindFirst( - c => c.Type == "TemporaryBadgeExpiry" && - c.Issuer == Startup.Authority).Value); - - if (temporaryBadgeExpiry > DateTime.Now) - { - context.Succeed(requirement); - } - } - } -} diff --git a/src/Yavsc/AuthorizationHandlers/ManageGitHookHandler.cs b/src/Yavsc/AuthorizationHandlers/ManageGitHookHandler.cs deleted file mode 100644 index f87c8dd3..00000000 --- a/src/Yavsc/AuthorizationHandlers/ManageGitHookHandler.cs +++ /dev/null @@ -1,18 +0,0 @@ -using Microsoft.AspNet.Authorization; -using Yavsc.Server.Models.IT.SourceCode; -using Yavsc.ViewModels.Auth; - -namespace Yavsc.AuthorizationHandlers -{ - public class ManageGitHookHandler: AuthorizationHandler - { - protected override void Handle(AuthorizationContext context, EditRequirement requirement, GitRepositoryReference resource) - { - if (context.User.IsInRole("FrontOffice")) - context.Succeed(requirement); - else if (context.User.Identity.IsAuthenticated) - context.Succeed(requirement); - } - - } -} \ No newline at end of file diff --git a/src/Yavsc/AuthorizationHandlers/PostUserFileHandler.cs b/src/Yavsc/AuthorizationHandlers/PostUserFileHandler.cs deleted file mode 100644 index ae6a3524..00000000 --- a/src/Yavsc/AuthorizationHandlers/PostUserFileHandler.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System.Security.Claims; -using Microsoft.AspNet.Authorization; -using Yavsc.ViewModels.Auth; - -namespace Yavsc.AuthorizationHandlers -{ - public class PostUserFileHandler : AuthorizationHandler - { - protected override void Handle(AuthorizationContext context, EditRequirement requirement, FileSpotInfo resource) - { - if (context.User.IsInRole(Constants.BlogModeratorGroupName) - || context.User.IsInRole(Constants.AdminGroupName)) - context.Succeed(requirement); - if (!context.User.Identity.IsAuthenticated) - context.Fail(); - if (resource.AuthorId == context.User.GetUserId()) - context.Succeed(requirement); - else context.Fail(); - } - - } -} \ No newline at end of file diff --git a/src/Yavsc/AuthorizationHandlers/SendMessageHandler.cs b/src/Yavsc/AuthorizationHandlers/SendMessageHandler.cs deleted file mode 100644 index 71d69c83..00000000 --- a/src/Yavsc/AuthorizationHandlers/SendMessageHandler.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System.Security.Claims; -using Microsoft.AspNet.Authorization; -using Yavsc.Models; -using Yavsc.ViewModels.Auth; -using System.Linq; - -namespace Yavsc.AuthorizationHandlers -{ - public class SendMessageHandler : AuthorizationHandler - { - readonly ApplicationDbContext _dbContext ; - - public SendMessageHandler(ApplicationDbContext dbContext) - { - _dbContext = dbContext; - } - - protected override void Handle(AuthorizationContext context, PrivateChatEntryRequirement requirement, string destUserId) - { - var uid = context.User.GetUserId(); - if (context.User.IsInRole(Constants.BlogModeratorGroupName) - || context.User.IsInRole(Constants.AdminGroupName)) - context.Succeed(requirement); - else if (!context.User.Identity.IsAuthenticated) - context.Fail(); - else if (destUserId == uid) - context.Succeed(requirement); - else if (_dbContext.Ban.Any(b=>b.TargetId == uid)) context.Fail(); - else if (_dbContext.BlackListed.Any(b=>b.OwnerId == destUserId && b.UserId == uid)) context.Fail(); - else context.Succeed(requirement); - } - - } -} diff --git a/src/Yavsc/AuthorizationHandlers/ViewFileHandler.cs b/src/Yavsc/AuthorizationHandlers/ViewFileHandler.cs deleted file mode 100644 index 73293b14..00000000 --- a/src/Yavsc/AuthorizationHandlers/ViewFileHandler.cs +++ /dev/null @@ -1,38 +0,0 @@ -using Microsoft.AspNet.Authorization; -using Microsoft.Extensions.Logging; -using Newtonsoft.Json; -using Yavsc.Services; -using Yavsc.ViewModels.Auth; - -namespace Yavsc.AuthorizationHandlers -{ - - public class ViewFileHandler : AuthorizationHandler - { - readonly IFileSystemAuthManager _authManager; - private readonly ILogger _logger; - - public ViewFileHandler(IFileSystemAuthManager authManager, ILoggerFactory logFactory) - { - _authManager = authManager; - _logger = logFactory.CreateLogger(); - } - - protected override void Handle(AuthorizationContext context, ViewRequirement requirement, ViewFileContext fileContext) - { - - var rights = _authManager.GetFilePathAccess(context.User, fileContext.File); - _logger.LogInformation("Got access value : " + rights); - if ((rights & FileAccessRight.Read) > 0) - { - _logger.LogInformation("Allowing access"); - context.Succeed(requirement); - } - else - { - _logger.LogInformation("Denying access"); - context.Fail(); - } - } - } -} diff --git a/src/Yavsc/AuthorizationServer/GoogleExtensions.cs b/src/Yavsc/AuthorizationServer/GoogleExtensions.cs deleted file mode 100644 index cc45557b..00000000 --- a/src/Yavsc/AuthorizationServer/GoogleExtensions.cs +++ /dev/null @@ -1,47 +0,0 @@ - -using System; -using Microsoft.AspNet.Builder; - -namespace Yavsc.Auth -{ - /// - /// Extension methods to add Google authentication capabilities to an HTTP application pipeline. - /// - public static class GoogleAppBuilderExtensions - { - /// - /// Adds the middleware to the specified , which enables Google authentication capabilities. - /// - /// The to add the middleware to. - /// A reference to this instance after the operation has completed. - public static IApplicationBuilder UseGoogleAuthentication(this IApplicationBuilder app) - { - if (app == null) - { - throw new ArgumentNullException(nameof(app)); - } - - return app.UseMiddleware(); - } - - /// - /// Adds the middleware to the specified , which enables Google authentication capabilities. - /// - /// The to add the middleware to. - /// A that specifies options for the middleware. - /// A reference to this instance after the operation has completed. - public static IApplicationBuilder UseGoogleAuthentication(this IApplicationBuilder app, YavscGoogleOptions options) - { - if (app == null) - { - throw new ArgumentNullException(nameof(app)); - } - if (options == null) - { - throw new ArgumentNullException(nameof(options)); - } - - return app.UseMiddleware(options); - } - } -} \ No newline at end of file diff --git a/src/Yavsc/AuthorizationServer/GoogleHandler.cs b/src/Yavsc/AuthorizationServer/GoogleHandler.cs deleted file mode 100644 index fe6f4d04..00000000 --- a/src/Yavsc/AuthorizationServer/GoogleHandler.cs +++ /dev/null @@ -1,141 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Net.Http; -using System.Net.Http.Headers; -using System.Security.Claims; -using System.Threading.Tasks; -using Microsoft.AspNet.Authentication; -using Microsoft.AspNet.Authentication.OAuth; -using Microsoft.AspNet.Http.Authentication; -using Microsoft.AspNet.WebUtilities; -using Microsoft.Extensions.Logging; -using Newtonsoft.Json.Linq; - -namespace Yavsc.Auth -{ - internal class GoogleHandler : OAuthHandler - { - private readonly ILogger _logger; - public GoogleHandler(HttpClient httpClient,ILogger logger) - : base(httpClient) - { - _logger = logger; - } - - protected override async Task CreateTicketAsync(ClaimsIdentity identity, - AuthenticationProperties properties, OAuthTokenResponse tokens -) - { - _logger.LogInformation("Getting user info from Google ..."); - // Get the Google user - var request = new HttpRequestMessage(HttpMethod.Get, Options.UserInformationEndpoint); - request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", tokens.AccessToken); - - var response = await Backchannel.SendAsync(request, Context.RequestAborted); - response.EnsureSuccessStatusCode(); - - var payload = JObject.Parse(await response.Content.ReadAsStringAsync()); - - var identifier = GoogleHelper.GetId(payload); - - - var ticket = new AuthenticationTicket(new ClaimsPrincipal(identity), properties, Options.AuthenticationScheme); - var context = new GoogleOAuthCreatingTicketContext(Context, Options, Backchannel, tokens, ticket, identifier); - - if (!string.IsNullOrEmpty(identifier)) - { - identity.AddClaim(new Claim(ClaimTypes.NameIdentifier, identifier, ClaimValueTypes.String, Options.ClaimsIssuer)); - } - - var givenName = GoogleHelper.GetGivenName(payload); - if (!string.IsNullOrEmpty(givenName)) - { - identity.AddClaim(new Claim(ClaimTypes.GivenName, givenName, ClaimValueTypes.String, Options.ClaimsIssuer)); - } - - var familyName = GoogleHelper.GetFamilyName(payload); - if (!string.IsNullOrEmpty(familyName)) - { - identity.AddClaim(new Claim(ClaimTypes.Surname, familyName, ClaimValueTypes.String, Options.ClaimsIssuer)); - } - - var name = GoogleHelper.GetName(payload); - if (!string.IsNullOrEmpty(name)) - { - identity.AddClaim(new Claim(ClaimTypes.Name, name, ClaimValueTypes.String, Options.ClaimsIssuer)); - } - - var email = GoogleHelper.GetEmail(payload); - if (!string.IsNullOrEmpty(email)) - { - identity.AddClaim(new Claim(ClaimTypes.Email, email, ClaimValueTypes.String, Options.ClaimsIssuer)); - } - - var profile = GoogleHelper.GetProfile(payload); - if (!string.IsNullOrEmpty(profile)) - { - identity.AddClaim(new Claim("urn:google:profile", profile, ClaimValueTypes.String, Options.ClaimsIssuer)); - } - - await Options.Events.CreatingTicket(context); - - return ticket; - } - protected override Task ExchangeCodeAsync(string code, string ruri) - { - var redirectUri = $"https://{Startup.Authority}{Options.CallbackPath}"; - return base.ExchangeCodeAsync(code,redirectUri); - } - - // TODO: Abstract this properties override pattern into the base class? - protected override string BuildChallengeUrl(AuthenticationProperties properties, string redirectUri) - { - - var scope = FormatScope(); - var queryStrings = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - { "response_type", "code" }, - { "client_id", Options.ClientId } - }; - // this runtime may not known this value, - // it should be get from config, - // And always be using a secure sheme ... since Google won't support anymore insecure ones. - _logger.LogInformation ($"Redirect uri was : {redirectUri}"); - - redirectUri = $"https://{Startup.Authority}{Options.CallbackPath}"; - queryStrings.Add("redirect_uri", redirectUri); - - _logger.LogInformation ($"Using redirect uri {redirectUri}"); - - AddQueryString(queryStrings, properties, "scope", scope); - - AddQueryString(queryStrings, properties, "access_type", Options.AccessType); - AddQueryString(queryStrings, properties, "approval_prompt"); - AddQueryString(queryStrings, properties, "login_hint"); - - var state = Options.StateDataFormat.Protect(properties); - queryStrings.Add("state", state); - - var authorizationEndpoint = QueryHelpers.AddQueryString(Options.AuthorizationEndpoint, queryStrings); - return authorizationEndpoint; - } - - - - private static void AddQueryString(IDictionary queryStrings, AuthenticationProperties properties, - string name, string defaultValue = null) - { - string value; - if (!properties.Items.TryGetValue(name, out value)) - { - value = defaultValue; - } - else - { - // Remove the parameter from AuthenticationProperties so it won't be serialized to state parameter - properties.Items.Remove(name); - } - queryStrings[name] = value; - } - } -} diff --git a/src/Yavsc/AuthorizationServer/GoogleHelper.cs b/src/Yavsc/AuthorizationServer/GoogleHelper.cs deleted file mode 100644 index aca7394d..00000000 --- a/src/Yavsc/AuthorizationServer/GoogleHelper.cs +++ /dev/null @@ -1,144 +0,0 @@ - - -using System; -using Newtonsoft.Json.Linq; -/// -/// Contains static methods that allow to extract user's information from a -/// instance retrieved from Google after a successful authentication process. -/// -public static class GoogleHelper - { - /// - /// Gets the Google user ID. - /// - public static string GetId(JObject user) - { - if (user == null) - { - throw new ArgumentNullException(nameof(user)); - } - - return user.Value("id"); - } - - /// - /// Gets the user's name. - /// - public static string GetName(JObject user) - { - if (user == null) - { - throw new ArgumentNullException(nameof(user)); - } - - return user.Value("displayName"); - } - - /// - /// Gets the user's given name. - /// - public static string GetGivenName(JObject user) - { - if (user == null) - { - throw new ArgumentNullException(nameof(user)); - } - - return TryGetValue(user, "name", "givenName"); - } - - /// - /// Gets the user's family name. - /// - public static string GetFamilyName(JObject user) - { - if (user == null) - { - throw new ArgumentNullException(nameof(user)); - } - - return TryGetValue(user, "name", "familyName"); - } - - /// - /// Gets the user's profile link. - /// - public static string GetProfile(JObject user) - { - if (user == null) - { - throw new ArgumentNullException(nameof(user)); - } - - return user.Value("url"); - } - - /// - /// Gets the user's email. - /// - public static string GetEmail(JObject user) - { - if (user == null) - { - throw new ArgumentNullException(nameof(user)); - } - - return TryGetFirstValue(user, "emails", "value"); - } - - // Get the given subProperty from a property. - private static string TryGetValue(JObject user, string propertyName, string subProperty) - { - JToken value; - if (user.TryGetValue(propertyName, out value)) - { - var subObject = JObject.Parse(value.ToString()); - if (subObject != null && subObject.TryGetValue(subProperty, out value)) - { - return value.ToString(); - } - } - return null; - } - -#if GoogleApisAuthOAuth2 - public static ServiceAccountCredential GetGoogleApiCredentials (string[] scopes) - { - String serviceAccountEmail = "SERVICE_ACCOUNT_EMAIL_HERE"; - - string private_key = Startup.GoogleSettings.Account.private_key; - - string secret = Startup.GoogleSettings.ClientSecret; - - - var certificate = new X509Certificate2(@"key.p12", secret, X509KeyStorageFlags.Exportable); - - return new ServiceAccountCredential( - new ServiceAccountCredential.Initializer(serviceAccountEmail) - { - Scopes = scopes - }.FromCertificate(certificate)); - } -#endif - // Get the given subProperty from a list property. - private static string TryGetFirstValue(JObject user, string propertyName, string subProperty) - { - JToken value; - if (user.TryGetValue(propertyName, out value)) - { - var array = JArray.Parse(value.ToString()); - if (array != null && array.Count > 0) - { - var subObject = JObject.Parse(array.First.ToString()); - if (subObject != null) - { - if (subObject.TryGetValue(subProperty, out value)) - { - return value.ToString(); - } - } - } - } - return null; - } - } \ No newline at end of file diff --git a/src/Yavsc/AuthorizationServer/GoogleMiddleWare.cs b/src/Yavsc/AuthorizationServer/GoogleMiddleWare.cs deleted file mode 100644 index dc91d168..00000000 --- a/src/Yavsc/AuthorizationServer/GoogleMiddleWare.cs +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using Microsoft.AspNet.Authentication; -using Microsoft.AspNet.Authentication.OAuth; -using Microsoft.AspNet.Builder; -using Microsoft.AspNet.DataProtection; -using Microsoft.Extensions.Logging; -using Microsoft.Extensions.OptionsModel; -using Microsoft.Extensions.WebEncoders; -namespace Yavsc.Auth -{ - /// - /// An ASP.NET Core middleware for authenticating users using Google OAuth 2.0. - /// - public class GoogleMiddleware : OAuthMiddleware - { - private readonly ILogger _logger; - - /// - /// Initializes a new . - /// - /// The next middleware in the HTTP pipeline to invoke. - /// - /// - /// - /// - /// Configuration options for the middleware. - public GoogleMiddleware( - RequestDelegate next, - IDataProtectionProvider dataProtectionProvider, - ILoggerFactory loggerFactory, - UrlEncoder encoder, - IOptions sharedOptions, - YavscGoogleOptions options) - : base(next, dataProtectionProvider, loggerFactory, encoder, sharedOptions, options) - { - - if (dataProtectionProvider == null) - { - throw new ArgumentNullException(nameof(dataProtectionProvider)); - } - - if (loggerFactory == null) - { - throw new ArgumentNullException(nameof(loggerFactory)); - } - _logger = loggerFactory.CreateLogger(); - - if (encoder == null) - { - throw new ArgumentNullException(nameof(encoder)); - } - - if (sharedOptions == null) - { - throw new ArgumentNullException(nameof(sharedOptions)); - } - - if (options == null) - { - throw new ArgumentNullException(nameof(options)); - } - - } - - protected override AuthenticationHandler CreateHandler() - { - return new GoogleHandler(Backchannel,_logger); - } - - } -} diff --git a/src/Yavsc/AuthorizationServer/GoogleOAuthCreatingTicket.cs b/src/Yavsc/AuthorizationServer/GoogleOAuthCreatingTicket.cs deleted file mode 100644 index c94cfde0..00000000 --- a/src/Yavsc/AuthorizationServer/GoogleOAuthCreatingTicket.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System.Net.Http; -using Microsoft.AspNet.Authentication; -using Microsoft.AspNet.Authentication.OAuth; -using Microsoft.AspNet.Http; - -namespace Yavsc.Auth { - - - public class GoogleOAuthCreatingTicketContext : OAuthCreatingTicketContext { - public GoogleOAuthCreatingTicketContext(HttpContext context, OAuthOptions options, - HttpClient backchannel, OAuthTokenResponse tokens, AuthenticationTicket ticket, string googleUserId ) - : base( context, options, backchannel, tokens ) - { - _ticket = ticket; - _googleUserId = googleUserId; - Principal = ticket.Principal; - } - - readonly AuthenticationTicket _ticket; - readonly string _googleUserId; - - public AuthenticationTicket Ticket { get { return _ticket; } } - - public string GoogleUserId { get { return _googleUserId; } } - } - - -} diff --git a/src/Yavsc/AuthorizationServer/GoogleOptions.cs b/src/Yavsc/AuthorizationServer/GoogleOptions.cs deleted file mode 100644 index 32779d0a..00000000 --- a/src/Yavsc/AuthorizationServer/GoogleOptions.cs +++ /dev/null @@ -1,46 +0,0 @@ -using Microsoft.AspNet.Authentication.OAuth; -using Microsoft.AspNet.Http; - -namespace Yavsc.Auth -{ - public static class YavscGoogleDefaults - { - public const string AuthenticationScheme = "Google"; - - public static readonly string AuthorizationEndpoint = "https://accounts.google.com/o/oauth2/auth"; - - public static readonly string TokenEndpoint = "https://www.googleapis.com/oauth2/v3/token"; - - public static readonly string UserInformationEndpoint = "https://www.googleapis.com/plus/v1/people/me"; - } - - /// - /// Configuration options for . - /// - public class YavscGoogleOptions : OAuthOptions - { - /// - /// Initializes a new . - /// - public YavscGoogleOptions() - { - AuthenticationScheme = YavscGoogleDefaults.AuthenticationScheme; - DisplayName = AuthenticationScheme; - CallbackPath = new PathString("/signin-google"); - AuthorizationEndpoint = YavscGoogleDefaults.AuthorizationEndpoint; - TokenEndpoint = YavscGoogleDefaults.TokenEndpoint; - UserInformationEndpoint = YavscGoogleDefaults.UserInformationEndpoint; - Scope.Add("openid"); - Scope.Add("profile"); - Scope.Add("email"); - - } - - /// - /// access_type. Set to 'offline' to request a refresh token. - /// - public string AccessType { get; set; } - - - } -} diff --git a/src/Yavsc/AuthorizationServer/MonoJwtSecurityTokenHandler.cs b/src/Yavsc/AuthorizationServer/MonoJwtSecurityTokenHandler.cs deleted file mode 100644 index 48f26127..00000000 --- a/src/Yavsc/AuthorizationServer/MonoJwtSecurityTokenHandler.cs +++ /dev/null @@ -1,40 +0,0 @@ - - - -using System; -using System.IdentityModel.Tokens; -using System.IdentityModel.Tokens.Jwt; -using System.Security.Claims; - -namespace Yavsc.Auth -{ - - public class MonoJwtSecurityTokenHandler : JwtSecurityTokenHandler - { - - public MonoJwtSecurityTokenHandler() - { - } - public override JwtSecurityToken CreateToken( - string issuer, - string audience, ClaimsIdentity subject, - DateTime? notBefore, DateTime? expires, DateTime? issuedAt, - SigningCredentials signingCredentials -) - { - SecurityTokenDescriptor tokenDescriptor = new SecurityTokenDescriptor - { - Audience = audience, - Claims = subject.Claims, - Expires = expires, - IssuedAt = issuedAt, - Issuer = issuer, - NotBefore = notBefore, - SigningCredentials = signingCredentials - }; - var token = base.CreateToken(tokenDescriptor); - return token as JwtSecurityToken; - } - } - -} diff --git a/src/Yavsc/AuthorizationServer/RSAKeyUtils.cs b/src/Yavsc/AuthorizationServer/RSAKeyUtils.cs deleted file mode 100644 index 85d28f64..00000000 --- a/src/Yavsc/AuthorizationServer/RSAKeyUtils.cs +++ /dev/null @@ -1,101 +0,0 @@ -using System.IO; -using System.Security.Cryptography; -using Newtonsoft.Json; - -namespace Yavsc -{ - public class RSAKeyUtils - { - public static RSAParameters GetRandomKey() - { - using (var rsa = new RSACryptoServiceProvider(2048)) - { - try - { - return rsa.ExportParameters(true); - } - finally - { - rsa.PersistKeyInCsp = false; - } - } - } - - public static RSAParameters GenerateKeyAndSave(string file) - { - var p = GetRandomKey(); - RSAParametersWithPrivate t = new RSAParametersWithPrivate(); - t.SetParameters(p); - File.WriteAllText(file, JsonConvert.SerializeObject(t)); - return p; - } - - /// - /// This expects a file in the format: - /// { - /// "Modulus": "z7eXmrs9z3Xm7VXwYIdziDYzXGfi3XQiozIRa58m3ApeLVDcsDeq6Iv8C5zJ2DHydDyc0x6o5dtTRIb23r5/ZRj4I/UwbgrwMk5iHA0bVsXVPBDSWsrVcPDGafr6YbUNQnNWIF8xOqgpeTwxrqGiCJMUjuKyUx01PBzpBxjpnQ++Ryz6Y7MLqKHxBkDiOw5wk9cxO8/IMspSNJJosOtRXFTR74+bj+pvNBa8IJ+5Jf/UfJEEjk+qC+pohCAryRk0ziXcPdxXEv5KGT4zf3LdtHy1YwsaGLnTb62vgbdqqCJaVyHWOoXsDTQBLjxNl9o9CzP6CrfBGK6JV8pA/xfQlw==", - /// "Exponent": "AQAB", - /// "P": "+VsETS2exORYlg2CxaRMzyG60dTfHSuv0CsfmO3PFv8mcYxglGa6bUV5VGtB6Pd1HdtV/iau1WR/hYXQphCP99Pu803NZvFvVi34alTFbh0LMfZ+2iQ9toGzVfO8Qdbj7go4TWoHNzCpG4UCx/9wicVIWJsNzkppSEcXYigADMM=", - /// "Q": "1UCJ2WAHasiCdwJtV2Ep0VCK3Z4rVFLWg3q1v5OoOU1CkX5/QAcrr6bX6zOdHR1bDCPsH1n1E9cCMvwakgi9M4Ch0dYF5CxDKtlx+IGsZJL0gB6HhcEsHat+yXUtOAlS4YB82G1hZqiDw+Q0O8LGyu/gLDPB+bn0HmbkUC2kP50=", - /// "DP": "CBqvLxr2eAu73VSfFXFblbfQ7JTwk3AiDK/6HOxNuL+eLj6TvP8BvB9v7BB4WewBAHFqgBIdyI21n09UErGjHDjlIT88F8ZtCe4AjuQmboe/H2aVhN18q/vXKkn7qmAjlE78uXdiuKZ6OIzAJGPm8nNZAJg5gKTmexTka6pFJiU=", - /// "DQ": "ND6zhwX3yzmEfROjJh0v2ZAZ9WGiy+3fkCaoEF9kf2VmQa70DgOzuDzv+TeT7mYawEasuqGXYVzztPn+qHhrogqJmpcMqnINopnTSka6rYkzTZAtM5+35yz0yvZiNbBTFdwcuglSK4xte7iU828stNs/2JR1mXDtVeVvWhVUgCE=", - /// "InverseQ": "Heo0BHv685rvWreFcI5MXSy3AN0Zs0YbwAYtZZd1K/OzFdYVdOnqw+Dg3wGU9yFD7h4icJFwZUBGOZ0ww/gZX/5ZgJK35/YY/DeV+qfZmywKauUzC6+DPsrDdW1uf1eAety6/huRZTduBFTwIOlPdZ+PY49j6S38DjPFNImn0cU=", - /// "D": "IvjMI5cGzxkQqkDf2cC0aOiHOTWccqCM/GD/odkH1+A+/u4wWdLliYWYB/R731R5d6yE0t7EnP6SRGVcxx/XnxPXI2ayorRgwHeF+ScTxUZFonlKkVK5IOzI2ysQYMb01o1IoOamCTQq12iVDMvV1g+9VFlCoM+4GMjdSv6cxn6ELabuD4nWt8tCskPjECThO+WdrknbUTppb2rRgMvNKfsPuF0H7+g+WisbzVS+UVRvJe3U5O5X5j7Z82Uq6hw2NCwv2YhQZRo/XisFZI7yZe0OU2JkXyNG3NCk8CgsM9yqX8Sk5esXMZdJzjwXtEpbR7FiKZXiz9LhPSmzxz/VsQ==" - /// } - /// - /// Generate - /// - /// - /// - public static RSAParameters GetKeyParameters(string file) - { - if (!File.Exists(file)) throw new FileNotFoundException("Check configuration - cannot find auth key file: " + file); - var keyParams = JsonConvert.DeserializeObject(File.ReadAllText(file)); - return keyParams.ToRSAParameters(); - } - - - /// - /// Util class to allow restoring RSA parameters from JSON as the normal - /// RSA parameters class won't restore private key info. - /// - private class RSAParametersWithPrivate - { - public byte[] D { get; set; } - public byte[] DP { get; set; } - public byte[] DQ { get; set; } - public byte[] Exponent { get; set; } - public byte[] InverseQ { get; set; } - public byte[] Modulus { get; set; } - public byte[] P { get; set; } - public byte[] Q { get; set; } - - public void SetParameters(RSAParameters p) - { - D = p.D; - DP = p.DP; - DQ = p.DQ; - Exponent = p.Exponent; - InverseQ = p.InverseQ; - Modulus = p.Modulus; - P = p.P; - Q = p.Q; - } - public RSAParameters ToRSAParameters() - { - return new RSAParameters() - { - D = this.D, - DP = this.DP, - DQ = this.DQ, - Exponent = this.Exponent, - InverseQ = this.InverseQ, - Modulus = this.Modulus, - P = this.P, - Q = this.Q - - }; - } - } - } -} diff --git a/src/Yavsc/AuthorizationServer/RequiredScopesMiddleware.cs b/src/Yavsc/AuthorizationServer/RequiredScopesMiddleware.cs deleted file mode 100644 index 85e161be..00000000 --- a/src/Yavsc/AuthorizationServer/RequiredScopesMiddleware.cs +++ /dev/null @@ -1,57 +0,0 @@ -using Microsoft.AspNet.Builder; -using Microsoft.AspNet.Http; -using System.Collections.Generic; -using System.Linq; -using System.Security.Claims; -using System.Threading.Tasks; - -namespace Api -{ - public class RequiredScopesMiddleware - { - private readonly RequestDelegate _next; - private readonly IEnumerable _requiredScopes; - - public RequiredScopesMiddleware(RequestDelegate next, IList requiredScopes) - { - _next = next; - _requiredScopes = requiredScopes; - } - - public async Task Invoke(HttpContext context) - { - if (context.User.Identity.IsAuthenticated) - { - if (!ScopePresent(context.User)) - { - context.Response.OnCompleted(Send403, context); - return; - } - } - - await _next(context); - } - - private bool ScopePresent(ClaimsPrincipal principal) - { - foreach (var scope in principal.FindAll("scope")) - { - if (_requiredScopes.Contains(scope.Value)) - { - return true; - } - } - - return false; - } - - private Task Send403(object contextObject) - { - var context = contextObject as HttpContext; - context.Response.StatusCode = 403; - - return Task.FromResult(0); - } - } -} - diff --git a/src/Yavsc/AuthorizationServer/TokenAuthOptions.cs b/src/Yavsc/AuthorizationServer/TokenAuthOptions.cs deleted file mode 100644 index 6864da37..00000000 --- a/src/Yavsc/AuthorizationServer/TokenAuthOptions.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System; -using System.IdentityModel.Tokens; - -namespace Yavsc -{ - [Obsolete("Use OAuth2AppSettings instead")] - public class TokenAuthOptions - { - /// - /// Public's identification - /// - /// - public string Audience { get; set; } - /// - /// Identity authority - /// - /// - public string Issuer { get; set; } - /// - /// Signin key and signature algotythm - /// - /// - public SigningCredentials SigningCredentials { get; set; } - public int ExpiresIn { get; set; } - } -} \ No newline at end of file diff --git a/src/Yavsc/AuthorizationServer/UserTokenProvider.cs b/src/Yavsc/AuthorizationServer/UserTokenProvider.cs deleted file mode 100644 index 28a13b4f..00000000 --- a/src/Yavsc/AuthorizationServer/UserTokenProvider.cs +++ /dev/null @@ -1,39 +0,0 @@ - -using System; -using System.Threading.Tasks; -using Microsoft.AspNet.DataProtection; -using Microsoft.AspNet.Identity; -using Yavsc.Models; -using Yavsc.Server; - -namespace Yavsc.Auth { - - public class UserTokenProvider : Microsoft.AspNet.Identity.IUserTokenProvider - { - public Task CanGenerateTwoFactorTokenAsync(UserManager manager, ApplicationUser user) - { - return Task.FromResult(true); - } - - public Task GenerateAsync(string purpose, UserManager manager, ApplicationUser user) - { - if ( user==null ) throw new InvalidOperationException("no user"); - var por = new MonoDataProtector(ServerConstants.ApplicationName, new string[] { purpose } ); - - return Task.FromResult(por.Protect(UserStamp(user))); - } - - public Task ValidateAsync(string purpose, string token, UserManager manager, ApplicationUser user) - { - var por = new MonoDataProtector(ServerConstants.ApplicationName,new string[] { purpose } ); - var userStamp = por.Unprotect(token); - Console.WriteLine ("Unprotected: "+userStamp); - string [] values = userStamp.Split(';'); - return Task.FromResult ( user.Id == values[0] && user.Email == values[1] && user.UserName == values[2]); - } - - public static string UserStamp(ApplicationUser user) { - return $"{user.Id};{user.Email};{user.UserName}"; - } - } -} diff --git a/src/Yavsc/AuthorizationServer/XmlEncryptor.cs b/src/Yavsc/AuthorizationServer/XmlEncryptor.cs deleted file mode 100644 index 92b322fd..00000000 --- a/src/Yavsc/AuthorizationServer/XmlEncryptor.cs +++ /dev/null @@ -1,23 +0,0 @@ - - - -using System; -using System.Xml.Linq; -using Microsoft.AspNet.DataProtection.XmlEncryption; - -namespace Yavsc.Auth { - - public class MonoXmlEncryptor : IXmlEncryptor - { - public MonoXmlEncryptor () - { - } - public EncryptedXmlInfo Encrypt(XElement plaintextElement) - { - var result = new EncryptedXmlInfo(plaintextElement, - typeof(MonoDataProtector)); - return result; - } - } - -} diff --git a/src/Yavsc/Controllers/Accounting/AccountController.cs b/src/Yavsc/Controllers/Accounting/AccountController.cs index 7cf657ae..cc8d0131 100644 --- a/src/Yavsc/Controllers/Accounting/AccountController.cs +++ b/src/Yavsc/Controllers/Accounting/AccountController.cs @@ -1,27 +1,20 @@ - -using System; -using System.Linq; using System.Security.Claims; -using System.Threading.Tasks; -using Microsoft.AspNet.Authorization; -using Microsoft.AspNet.Identity; -using Microsoft.AspNet.Mvc; -using Microsoft.AspNet.Mvc.Rendering; -using Microsoft.Extensions.Logging; -using Microsoft.Extensions.OptionsModel; -using Microsoft.AspNet.Http; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Identity; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.Rendering; using Yavsc.Models; using Yavsc.Services; using Yavsc.ViewModels.Account; using Microsoft.Extensions.Localization; -using Microsoft.Data.Entity; using Newtonsoft.Json; namespace Yavsc.Controllers { + using Microsoft.EntityFrameworkCore; + using Microsoft.Extensions.Options; using Yavsc.Abstract.Manage; - using Yavsc.Auth; using Yavsc.Helpers; public class AccountController : Controller @@ -54,11 +47,6 @@ namespace Yavsc.Controllers { _userManager = userManager; _signInManager = signInManager; - var emailUserTokenProvider = new UserTokenProvider(); - _userManager.RegisterTokenProvider("EmailConfirmation", emailUserTokenProvider); - _userManager.RegisterTokenProvider("ResetPassword", emailUserTokenProvider); - // _userManager.RegisterTokenProvider("SMS",new UserTokenProvider()); - // _userManager.RegisterTokenProvider("Phone", new UserTokenProvider()); _emailSender = emailSender; _siteSettings = siteSettings.Value; _twilioSettings = twilioSettings.Value; @@ -86,7 +74,7 @@ namespace Yavsc.Controllers var toShow = users.Skip(shown).Take(pageLen); ViewBag.page = pageNum; - ViewBag.hasNext = await users.CountAsync() > (toShow.Count() + shown); + ViewBag.hasNext = users.Count() > (toShow.Count() + shown); ViewBag.nextpage = pageNum+1; ViewBag.pageLen = pageLen; // ApplicationUser user; @@ -122,7 +110,8 @@ namespace Yavsc.Controllers [AllowAnonymous] public ActionResult AccessDenied(string requestUrl = null) { - ViewBag.UserIsSignedIn = User.IsSignedIn(); + ViewBag.UserIsSignedIn = User.Identity.IsAuthenticated; + if (string.IsNullOrWhiteSpace(requestUrl)) if (string.IsNullOrWhiteSpace(Request.Headers["Referer"])) requestUrl = "/"; @@ -198,13 +187,7 @@ namespace Yavsc.Controllers if (string.IsNullOrEmpty(model.Provider)) { _logger.LogWarning("Provider not specified"); - return HttpBadRequest(); - } - - if (!_signInManager.GetExternalAuthenticationSchemes().Any(x => x.AuthenticationScheme == model.Provider)) - { - _logger.LogWarning($"Provider not found : {model.Provider}"); - return HttpBadRequest(); + return BadRequest(); } // Instruct the middleware corresponding to the requested external identity @@ -217,7 +200,7 @@ namespace Yavsc.Controllers if (string.IsNullOrEmpty(model.ReturnUrl)) { _logger.LogWarning("ReturnUrl not specified"); - return HttpBadRequest(); + return BadRequest(); } // Note: this still is not the redirect uri given to the third party provider, at building the challenge. var redirectUrl = Url.Action("ExternalLoginCallback", "Account", new { model.ReturnUrl }, protocol:"https", host: Startup.Authority); @@ -364,7 +347,8 @@ namespace Yavsc.Controllers } // Sign in the user with this external login provider if the user already has a login. - info.ProviderDisplayName = info.ExternalPrincipal.Claims.First(c => c.Type == "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name")?.Value; + throw new NotImplementedException(); + // info.ProviderDisplayName = info.ExternalPrincipal.Claims.First(c => c.Type == "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name")?.Value; var result = await _signInManager.ExternalLoginSignInAsync(info.LoginProvider, info.ProviderKey, isPersistent: false); if (result.Succeeded) @@ -392,9 +376,9 @@ namespace Yavsc.Controllers // If the user does not have an account, then ask the user to create an account. ViewData["ReturnUrl"] = returnUrl; ViewData["LoginProvider"] = info.LoginProvider; - var email = info.ExternalPrincipal.FindFirstValue(ClaimTypes.Email); - var name = info.ExternalPrincipal.FindFirstValue(ClaimTypes.Name); - var avatar = info.ExternalPrincipal.FindFirstValue("urn:google:profile"); + var email = info.AuthenticationProperties.GetParameter(ClaimTypes.Email); + var name = info.AuthenticationProperties.GetParameter(ClaimTypes.Name); + var avatar = info.AuthenticationProperties.GetParameter("urn:google:profile"); /* var phone = info.ExternalPrincipal.FindFirstValue(ClaimTypes.HomePhone); var mobile = info.ExternalPrincipal.FindFirstValue(ClaimTypes.MobilePhone); var postalcode = info.ExternalPrincipal.FindFirstValue(ClaimTypes.PostalCode); @@ -403,9 +387,9 @@ namespace Yavsc.Controllers foreach (var claim in info.ExternalPrincipal.Claims) _logger.LogWarning("# {0} Claim: {1} {2}", info.LoginProvider, claim.Type, claim.Value); */ - var access_token = info.ExternalPrincipal.FindFirstValue("access_token"); - var token_type = info.ExternalPrincipal.FindFirstValue("token_type"); - var expires_in = info.ExternalPrincipal.FindFirstValue("expires_in"); + var access_token = info.AuthenticationProperties.GetParameter("access_token"); + var token_type = info.AuthenticationProperties.GetParameter("token_type"); + var expires_in = info.AuthenticationProperties.GetParameter("expires_in"); return View("ExternalLoginConfirmation", new ExternalLoginConfirmationViewModel { @@ -439,7 +423,8 @@ namespace Yavsc.Controllers var result = await _userManager.CreateAsync(user); if (result.Succeeded) { - info.ProviderDisplayName = info.ExternalPrincipal.Claims.First(c => c.Type == "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name")?.Value; + throw new NotImplementedException(); + // info.ProviderDisplayName = info.Claims.First(c => c.Type == "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name")?.Value; result = await _userManager.AddLoginAsync(user, info); if (result.Succeeded) diff --git a/src/Yavsc/Controllers/Accounting/ManageController.cs b/src/Yavsc/Controllers/Accounting/ManageController.cs index c7d71654..e54cee73 100644 --- a/src/Yavsc/Controllers/Accounting/ManageController.cs +++ b/src/Yavsc/Controllers/Accounting/ManageController.cs @@ -1,27 +1,22 @@ -using System.Linq; -using System.Threading.Tasks; using System.Security.Claims; -using Microsoft.AspNet.Identity; -using Microsoft.AspNet.Mvc; -using Microsoft.Extensions.Logging; -using Microsoft.Extensions.OptionsModel; -using Microsoft.Data.Entity; -using System; -using System.Collections.Generic; +using System.IO; +using Microsoft.AspNetCore.Identity; +using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Localization; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Options; using Yavsc.Models.Workflow; +using Yavsc.Helpers; +using Yavsc.Models.Relationship; +using Yavsc.Models.Bank; +using Yavsc.ViewModels.Calendar; +using Yavsc.Models; +using Yavsc.Services; +using Yavsc.ViewModels.Manage; namespace Yavsc.Controllers { - using Yavsc.Helpers; - using Models.Relationship; - using Models.Bank; - using ViewModels.Calendar; - using Yavsc.Models; - using Yavsc.Services; - using Yavsc.ViewModels.Manage; - using System.IO; public class ManageController : Controller { @@ -298,7 +293,7 @@ namespace Yavsc.Controllers public async Task SetGoogleCalendar(string returnUrl, string pageToken) { - var uid = User.GetUserId(); + var uid = User.FindFirstValue(ClaimTypes.NameIdentifier); var calendars = await _calendarManager.GetCalendarsAsync(pageToken); return View(new SetGoogleCalendarViewModel { @@ -321,7 +316,7 @@ namespace Yavsc.Controllers [HttpGet] public async Task AddBankInfo() { - var uid = User.GetUserId(); + var uid = User.FindFirstValue(ClaimTypes.NameIdentifier); var user = await _dbContext.Users.Include(u=>u.BankInfo).SingleAsync(u=>u.Id==uid); return View(user.BankInfo); @@ -333,7 +328,7 @@ namespace Yavsc.Controllers if (ModelState.IsValid) { // TODO PostBankInfoRequirement & auth - var uid = User.GetUserId(); + var uid = User.FindFirstValue(ClaimTypes.NameIdentifier); var user = _dbContext.Users.Include(u=>u.BankInfo) .Single(u=>u.Id == uid); @@ -496,13 +491,12 @@ namespace Yavsc.Controllers return View("Error"); } var userLogins = await _userManager.GetLoginsAsync(user); - var otherLogins = _signInManager.GetExternalAuthenticationSchemes().Where(auth => userLogins.All(ul => auth.AuthenticationScheme != ul.LoginProvider)).ToList(); + ViewData["ShowRemoveButton"] = user.PasswordHash != null || userLogins.Count > 1; return View(new ManageLoginsViewModel { - CurrentLogins = userLogins, - OtherLogins = otherLogins + CurrentLogins = userLogins }); } @@ -720,7 +714,7 @@ namespace Yavsc.Controllers [HttpGet] public async Task SetAddress() { - var uid = User.GetUserId(); + var uid = User.FindFirstValue(ClaimTypes.NameIdentifier); var user = await _dbContext.Users.Include(u=>u.PostalAddress).SingleAsync(u=>u.Id==uid); ViewBag.GoogleSettings = _googleSettings; return View (user.PostalAddress ?? new Location()); @@ -730,7 +724,7 @@ namespace Yavsc.Controllers public async Task SetAddress(Location model) { if (ModelState.IsValid) { - var uid = User.GetUserId(); + var uid = User.FindFirstValue(ClaimTypes.NameIdentifier); var user = _dbContext.Users.Include(u=>u.PostalAddress).Single(u=>u.Id==uid); diff --git a/src/Yavsc/Controllers/Accounting/OAuthController.cs b/src/Yavsc/Controllers/Accounting/OAuthController.cs deleted file mode 100644 index 446fc372..00000000 --- a/src/Yavsc/Controllers/Accounting/OAuthController.cs +++ /dev/null @@ -1,148 +0,0 @@ -using System.Collections.Generic; -using System.Linq; -using System.Security.Claims; -using System.Threading.Tasks; -using Microsoft.AspNet.Authorization; -using Microsoft.AspNet.DataProtection.KeyManagement; -using Microsoft.AspNet.Http.Authentication; -using Microsoft.AspNet.Identity; -using Microsoft.AspNet.Mvc; -using Microsoft.AspNet.WebUtilities; -using Microsoft.Extensions.Logging; -using Microsoft.Extensions.OptionsModel; -using Microsoft.Extensions.Primitives; -using OAuth.AspNet.AuthServer; -using Yavsc.Models; -using Yavsc.Models.Auth; - -namespace Yavsc.Controllers -{ - [AllowAnonymous] - public class OAuthController : Controller - { - readonly ILogger _logger; - - public OAuthController(ILoggerFactory loggerFactory) - { - _logger = loggerFactory.CreateLogger(); - } - - - [HttpGet("~/api/getclaims"), Produces("application/json")] - - public IActionResult GetClaims() - { - var identity = User.Identity as ClaimsIdentity; - - var claims = from c in identity.Claims - select new - { - subject = c.Subject.Name, - type = c.Type, - value = c.Value - }; - - return Ok(claims); - } - - [HttpGet(Constants.AuthorizePath),HttpPost(Constants.AuthorizePath)] - public async Task Authorize() - { - if (Response.StatusCode != 200) - { - if (Request.Headers.Keys.Contains("Accept")) { - var accepted = Request.Headers["Accept"]; - if (accepted.Contains("application/json")) - { - _logger.LogError("Invalid http status at authorisation"); - return new BadRequestObjectResult(new { error = Response.StatusCode} ); - } - } - - return View("AuthorizeError"); - } - - AuthenticationManager authentication = Request.HttpContext.Authentication; - var appAuthSheme = Startup.IdentityAppOptions.Cookies.ApplicationCookieAuthenticationScheme; - - ClaimsPrincipal principal = await authentication.AuthenticateAsync(appAuthSheme); - - if (principal == null) - { - await authentication.ChallengeAsync(appAuthSheme); - - if (Response.StatusCode == 200) - return new HttpUnauthorizedResult(); - - return new HttpStatusCodeResult(Response.StatusCode); - } - - string[] scopes = { }; - string redirect_uri=null; - - IDictionary queryStringComponents = null; - - if (Request.QueryString.HasValue) - { - queryStringComponents = QueryHelpers.ParseQuery(Request.QueryString.Value); - - if (queryStringComponents.ContainsKey("scope")) - scopes = ((string)queryStringComponents["scope"]).Split(' '); - if (queryStringComponents.ContainsKey("redirect_uri")) - redirect_uri = queryStringComponents["redirect_uri"]; - } - var username = User.GetUserName(); - - var model = new AuthorisationView { - Scopes = (Constants.SiteScopes.Where(s=> scopes.Contains(s.Id))).ToArray(), - Message = $"Bienvenue {username}." - } ; - - if (Request.Method == "POST") - { - if (!string.IsNullOrEmpty(Request.Form["submit.Grant"])) - { - principal = new ClaimsPrincipal(principal.Identities); - - ClaimsIdentity primaryIdentity = (ClaimsIdentity)principal.Identity; - - foreach (var scope in scopes) - { - primaryIdentity.AddClaim(new Claim("urn:oauth:scope", scope)); - } - await authentication.SignInAsync(OAuthDefaults.AuthenticationType, principal); - } - if (!string.IsNullOrEmpty(Request.Form["submit.Deny"])) - { - await authentication.SignOutAsync(appAuthSheme); - if (redirect_uri!=null) - return Redirect(redirect_uri+"?error=scope-denied"); - return Redirect("/"); - } - if (!string.IsNullOrEmpty(Request.Form["submit.Login"])) - { - await authentication.SignOutAsync(appAuthSheme); - await authentication.ChallengeAsync(appAuthSheme); - return new HttpUnauthorizedResult(); - } - } - - if (Request.Headers.Keys.Contains("Accept")) { - var accepted = Request.Headers["Accept"]; - if (accepted.Contains("application/json")) - { - _logger.LogInformation("serving available scopes"); - return Ok(model); - } - } - return View(model); - } - - [HttpGet("~/oauth/success")] - public IActionResult NativeAuthSuccess () - { - return RedirectToAction("Index","Home"); - } - - } -} diff --git a/src/Yavsc/Controllers/Accounting/UsersController.cs b/src/Yavsc/Controllers/Accounting/UsersController.cs index 4fb7cf77..fbce0c22 100644 --- a/src/Yavsc/Controllers/Accounting/UsersController.cs +++ b/src/Yavsc/Controllers/Accounting/UsersController.cs @@ -1,8 +1,8 @@ using System.Threading.Tasks; -using Microsoft.AspNet.Authorization; -using Microsoft.AspNet.Mvc; -using Microsoft.AspNet.Mvc.Rendering; -using Microsoft.Data.Entity; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.Rendering; +using Microsoft.EntityFrameworkCore; using Yavsc.Models; namespace Yavsc.Controllers @@ -29,13 +29,13 @@ namespace Yavsc.Controllers { if (id == null) { - return HttpNotFound(); + return NotFound(); } ApplicationUser applicationUser = await _context.ApplicationUser.SingleAsync(m => m.Id == id); if (applicationUser == null) { - return HttpNotFound(); + return NotFound(); } return View(applicationUser); @@ -68,13 +68,13 @@ namespace Yavsc.Controllers { if (id == null) { - return HttpNotFound(); + return NotFound(); } ApplicationUser applicationUser = await _context.ApplicationUser.SingleAsync(m => m.Id == id); if (applicationUser == null) { - return HttpNotFound(); + return NotFound(); } ViewData["PostalAddressId"] = new SelectList(_context.Locations, "Id", "PostalAddress", applicationUser.PostalAddressId); return View(applicationUser); @@ -101,13 +101,13 @@ namespace Yavsc.Controllers { if (id == null) { - return HttpNotFound(); + return NotFound(); } ApplicationUser applicationUser = await _context.ApplicationUser.SingleAsync(m => m.Id == id); if (applicationUser == null) { - return HttpNotFound(); + return NotFound(); } return View(applicationUser); diff --git a/src/Yavsc/Controllers/Administration/AdministrationController.cs b/src/Yavsc/Controllers/Administration/AdministrationController.cs index b6110d33..eda0891f 100644 --- a/src/Yavsc/Controllers/Administration/AdministrationController.cs +++ b/src/Yavsc/Controllers/Administration/AdministrationController.cs @@ -1,14 +1,11 @@ -using System.Linq; -using System.Security.Claims; -using System.Threading.Tasks; -using Microsoft.AspNet.Authorization; -using Microsoft.AspNet.Identity; -using Microsoft.AspNet.Identity.EntityFramework; -using Microsoft.AspNet.Mvc; -using Microsoft.AspNet.Mvc.Rendering; -using Microsoft.Data.Entity; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Identity; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.Rendering; +using Microsoft.EntityFrameworkCore; using Yavsc.Abstract.Identity; +using Yavsc.Helpers; using Yavsc.Models; using Yavsc.ViewModels; using Yavsc.ViewModels.Administration; @@ -75,7 +72,7 @@ namespace Yavsc.Controllers return Ok(new { message = "you already got it." }); } - return HttpNotFound(); + return NotFound(); } var user = await _userManager.FindByIdAsync(User.GetUserId()); @@ -105,12 +102,10 @@ namespace Yavsc.Controllers var youAreAdmin = await _userManager.IsInRoleAsync( await _userManager.FindByIdAsync(User.GetUserId()), Constants.AdminGroupName); - var roles = _roleManager.Roles.Include( - x => x.Users - ).Select(x => new RoleInfo { + throw new NotImplementedException(); + var roles = _roleManager.Roles.Select(x => new RoleInfo { Id = x.Id, - Name = x.Name, - Users = x.Users.Select(u=>u.UserId).ToArray() + Name = x.Name }); var assembly = GetType().Assembly; ViewBag.ThisAssembly = assembly.FullName; @@ -125,26 +120,6 @@ namespace Yavsc.Controllers }); } - public IActionResult Role(string id) - { - IdentityRole role = _roleManager.Roles - .Include(r=>r.Users).FirstOrDefault - ( r=> r.Id == id ); - var ri = GetRoleUserCollection(role); - return View("Role",ri); - } - - public RoleUserCollection GetRoleUserCollection(IdentityRole role) - { - var result = new RoleUserCollection { - Id = role.Id, - Name = role.Name, - Users = _dbContext.Users.Where(u=>role.Users.Any(ru => u.Id == ru.UserId)) - .Select( u => new UserInfo { UserName = u.UserName, Avatar = u.Avatar, UserId = u.Id } ) - .ToArray() - }; - return result; - } [Authorize("AdministratorOnly")] public IActionResult Enroll(string roleName) @@ -160,7 +135,7 @@ namespace Yavsc.Controllers if (ModelState.IsValid) { var newAdmin = await _dbContext.Users.FirstOrDefaultAsync(u=>u.Id==model.EnroledUserId); - if (newAdmin==null) return HttpNotFound(); + if (newAdmin==null) return NotFound(); var addToRoleResult = await _userManager.AddToRoleAsync(newAdmin, model.RoleName); if (addToRoleResult.Succeeded) { @@ -176,7 +151,7 @@ namespace Yavsc.Controllers public async Task Fire(string roleName, string userId) { var user = await _dbContext.Users.FirstOrDefaultAsync(u=>u.Id==userId); - if (user == null) return HttpNotFound(); + if (user == null) return NotFound(); return View(new FireViewModel{ RoleName = roleName, EnroledUserId = userId, EnroledUserName = user.UserName }); } @@ -188,7 +163,7 @@ namespace Yavsc.Controllers if (ModelState.IsValid) { var oldEnroled = await _dbContext.Users.FirstOrDefaultAsync(u=>u.Id==model.EnroledUserId); - if (oldEnroled==null) return HttpNotFound(); + if (oldEnroled==null) return NotFound(); var removeFromRole = await _userManager.RemoveFromRoleAsync(oldEnroled, model.RoleName); if (removeFromRole.Succeeded) { diff --git a/src/Yavsc/Controllers/Administration/MailingTemplateController.cs b/src/Yavsc/Controllers/Administration/MailingTemplateController.cs index 5fe80c6c..8168720f 100644 --- a/src/Yavsc/Controllers/Administration/MailingTemplateController.cs +++ b/src/Yavsc/Controllers/Administration/MailingTemplateController.cs @@ -1,18 +1,13 @@ -using System; -using System.Collections.Generic; -using System.Threading.Tasks; -using System.Security.Claims; -using Microsoft.AspNet.Mvc; -using Microsoft.AspNet.Mvc.Rendering; -using Microsoft.Data.Entity; + +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.Rendering; using Yavsc.Models; using Yavsc.Models.Calendar; using Yavsc.Server.Models.EMailing; -using Microsoft.AspNet.Authorization; -using Yavsc.Templates; -using System.Linq; -using Microsoft.Extensions.Logging; +using Microsoft.AspNetCore.Authorization; using Yavsc.Server.Settings; +using Microsoft.EntityFrameworkCore; +using Yavsc.Helpers; namespace Yavsc.Controllers { @@ -42,13 +37,13 @@ namespace Yavsc.Controllers { if (id == null) { - return HttpNotFound(); + return NotFound(); } MailingTemplate mailingTemplate = await _context.MailingTemplate.SingleAsync(m => m.Id == id); if (mailingTemplate == null) { - return HttpNotFound(); + return NotFound(); } return View(mailingTemplate); @@ -101,13 +96,13 @@ namespace Yavsc.Controllers { if (id == null) { - return HttpNotFound(); + return NotFound(); } MailingTemplate mailingTemplate = await _context.MailingTemplate.SingleAsync(m => m.Id == id); if (mailingTemplate == null) { - return HttpNotFound(); + return NotFound(); } SetupViewBag(); return View(mailingTemplate); @@ -135,13 +130,13 @@ namespace Yavsc.Controllers { if (id == null) { - return HttpNotFound(); + return NotFound(); } MailingTemplate mailingTemplate = await _context.MailingTemplate.SingleAsync(m => m.Id == id); if (mailingTemplate == null) { - return HttpNotFound(); + return NotFound(); } return View(mailingTemplate); diff --git a/src/Yavsc/Controllers/Communicating/AnnouncesController.cs b/src/Yavsc/Controllers/Communicating/AnnouncesController.cs index 79b0a6cf..ac3ae0b7 100644 --- a/src/Yavsc/Controllers/Communicating/AnnouncesController.cs +++ b/src/Yavsc/Controllers/Communicating/AnnouncesController.cs @@ -1,13 +1,13 @@ using System.Threading.Tasks; using Yavsc.ViewModels.Auth; -using Microsoft.AspNet.Authorization; -using Microsoft.AspNet.Mvc; -using Microsoft.Data.Entity; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; using Yavsc.Models; using Yavsc.Models.Messaging; using Microsoft.Extensions.Localization; using System.Collections.Generic; -using Microsoft.AspNet.Mvc.Rendering; +using Microsoft.AspNetCore.Mvc.Rendering; +using Microsoft.EntityFrameworkCore; namespace Yavsc.Controllers { @@ -37,13 +37,13 @@ namespace Yavsc.Controllers { if (id == null) { - return HttpNotFound(); + return NotFound(); } Announce announce = await _context.Announce.SingleAsync(m => m.Id == id); if (announce == null) { - return HttpNotFound(); + return NotFound(); } return View(announce); @@ -60,7 +60,7 @@ namespace Yavsc.Controllers { ViewBag.IsAdmin = User.IsInRole(Constants.AdminGroupName); ViewBag.IsPerformer = User.IsInRole(Constants.PerformerGroupName); - ViewBag.AllowEdit = announce==null || announce.Id<=0 || await _authorizationService.AuthorizeAsync(User,announce,new EditRequirement()); + ViewBag.AllowEdit = announce==null || announce.Id<=0 || !_authorizationService.AuthorizeAsync(User,announce,new EditRequirement()).IsFaulted; List dl = new List(); var rnames = System.Enum.GetNames(typeof(Reason)); var rvalues = System.Enum.GetValues(typeof(Reason)); @@ -107,13 +107,13 @@ namespace Yavsc.Controllers { if (id == null) { - return HttpNotFound(); + return NotFound(); } Announce announce = await _context.Announce.SingleAsync(m => m.Id == id); if (announce == null) { - return HttpNotFound(); + return NotFound(); } return View(announce); } @@ -138,13 +138,13 @@ namespace Yavsc.Controllers { if (id == null) { - return HttpNotFound(); + return NotFound(); } Announce announce = await _context.Announce.SingleAsync(m => m.Id == id); if (announce == null) { - return HttpNotFound(); + return NotFound(); } return View(announce); diff --git a/src/Yavsc/Controllers/Communicating/BlogspotController.cs b/src/Yavsc/Controllers/Communicating/BlogspotController.cs index 2e16cf07..af567dd6 100644 --- a/src/Yavsc/Controllers/Communicating/BlogspotController.cs +++ b/src/Yavsc/Controllers/Communicating/BlogspotController.cs @@ -2,18 +2,18 @@ using System.Linq; using System.Security.Claims; using System.Threading.Tasks; -using Microsoft.AspNet.Identity; -using Microsoft.AspNet.Mvc; +using Microsoft.AspNetCore.Identity; +using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Logging; -using Microsoft.AspNet.Authorization; -using Microsoft.Data.Entity; -using Microsoft.Extensions.OptionsModel; +using Microsoft.AspNetCore.Authorization; using Yavsc.Models; using Yavsc.ViewModels.Auth; -using Microsoft.AspNet.Mvc.Rendering; +using Microsoft.AspNetCore.Mvc.Rendering; using Yavsc.Models.Blog; using Yavsc.Helpers; -using Microsoft.AspNet.Localization; +using Microsoft.AspNetCore.Localization; +using Microsoft.Extensions.Options; +using Microsoft.EntityFrameworkCore; // For more information on enabling Web API for empty projects, visit http://go.microsoft.com/fwlink/?LinkID=397860 @@ -52,7 +52,7 @@ namespace Yavsc.Controllers [AllowAnonymous] public IActionResult Title(string id) { - var uid = User.GetUserId(); + var uid = User.FindFirstValue(ClaimTypes.NameIdentifier); ViewData["Title"] = id; return View("Title", _context.Blogspot.Include( b => b.Author @@ -75,7 +75,7 @@ namespace Yavsc.Controllers { if (id == null) { - return HttpNotFound(); + return NotFound(); } BlogPost blog = _context.Blogspot @@ -86,9 +86,9 @@ namespace Yavsc.Controllers .Single(m => m.Id == id); if (blog == null) { - return HttpNotFound(); + return NotFound(); } - if (!await _authorizationService.AuthorizeAsync(User, blog, new ViewRequirement())) + if ( _authorizationService.AuthorizeAsync(User, blog, new ViewRequirement()).IsFaulted) { return new ChallengeResult(); } @@ -141,7 +141,7 @@ namespace Yavsc.Controllers { if (id == null) { - return HttpNotFound(); + return NotFound(); } ViewData["PostTarget"]="Edit"; @@ -150,9 +150,9 @@ namespace Yavsc.Controllers if (blog == null) { - return HttpNotFound(); + return NotFound(); } - if (await _authorizationService.AuthorizeAsync(User, blog, new EditRequirement())) + if (!_authorizationService.AuthorizeAsync(User, blog, new EditRequirement()).IsFaulted) { ViewBag.ACL = _context.Circle.Where( c=>c.OwnerId == blog.AuthorId) @@ -181,7 +181,7 @@ namespace Yavsc.Controllers if (ModelState.IsValid) { var auth = _authorizationService.AuthorizeAsync(User, blog, new EditRequirement()); - if (auth.Result) + if (!auth.IsFaulted) { // saves the change _context.Update(blog); @@ -205,7 +205,7 @@ namespace Yavsc.Controllers { if (id == null) { - return HttpNotFound(); + return NotFound(); } BlogPost blog = _context.Blogspot.Include( @@ -213,7 +213,7 @@ namespace Yavsc.Controllers ).Single(m => m.Id == id); if (blog == null) { - return HttpNotFound(); + return NotFound(); } return View(blog); @@ -224,13 +224,11 @@ namespace Yavsc.Controllers [ValidateAntiForgeryToken] public IActionResult DeleteConfirmed(long id) { - BlogPost blog = _context.Blogspot.Single(m => m.Id == id); - var auth = _authorizationService.AuthorizeAsync(User, blog, new EditRequirement()); - if (auth.Result) - { - _context.Blogspot.Remove(blog); - _context.SaveChanges(User.GetUserId()); - } + BlogPost blog = _context.Blogspot.Single(m => m.Id == id && m.GetOwnerId()== User.GetUserId()); + + _context.Blogspot.Remove(blog); + _context.SaveChanges(User.GetUserId()); + return RedirectToAction("Index"); } } diff --git a/src/Yavsc/Controllers/Communicating/CircleController.cs b/src/Yavsc/Controllers/Communicating/CircleController.cs index 80fc424b..c0e44754 100644 --- a/src/Yavsc/Controllers/Communicating/CircleController.cs +++ b/src/Yavsc/Controllers/Communicating/CircleController.cs @@ -1,9 +1,8 @@ -using System.Linq; using System.Security.Claims; -using System.Threading.Tasks; -using Microsoft.AspNet.Mvc; -using Microsoft.Data.Entity; +using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; +using Yavsc.Helpers; using Yavsc.Models; using Yavsc.Models.Relationship; @@ -29,16 +28,16 @@ namespace Yavsc.Controllers { if (id == null) { - return HttpNotFound(); + return NotFound(); } Circle circle = await _context.Circle.SingleAsync(m => m.Id == id); if (circle == null) { - return HttpNotFound(); + return NotFound(); } - var uid = User.GetUserId(); - if (uid != circle.OwnerId) return this.HttpUnauthorized(); + var uid = User.FindFirstValue(ClaimTypes.NameIdentifier); + if (uid != circle.OwnerId) return this.Unauthorized(); return View(circle); } @@ -53,11 +52,11 @@ namespace Yavsc.Controllers [ValidateAntiForgeryToken] public async Task Create(Circle circle) { - var uid = User.GetUserId(); + var uid = User.FindFirstValue(ClaimTypes.NameIdentifier); if (ModelState.IsValid) { if (uid != circle.OwnerId) - return this.HttpUnauthorized(); + return this.Unauthorized(); _context.Circle.Add(circle); await _context.SaveChangesAsync(uid); @@ -71,18 +70,18 @@ namespace Yavsc.Controllers { if (id == null) { - return HttpNotFound(); + return NotFound(); } Circle circle = await _context.Circle.SingleAsync(m => m.Id == id); if (circle == null) { - return HttpNotFound(); + return NotFound(); } - var uid = User.GetUserId(); + var uid = User.FindFirstValue(ClaimTypes.NameIdentifier); if (uid != circle.OwnerId) - return this.HttpUnauthorized(); + return Unauthorized(); return View(circle); } @@ -94,8 +93,8 @@ namespace Yavsc.Controllers if (ModelState.IsValid) { - var uid = User.GetUserId(); - if (uid != circle.OwnerId) return this.HttpUnauthorized(); + var uid = User.FindFirstValue(ClaimTypes.NameIdentifier); + if (uid != circle.OwnerId) return Unauthorized(); _context.Update(circle); await _context.SaveChangesAsync(uid); return RedirectToAction("Index"); @@ -109,16 +108,16 @@ namespace Yavsc.Controllers { if (id == null) { - return HttpNotFound(); + return NotFound(); } Circle circle = await _context.Circle.SingleAsync(m => m.Id == id); if (circle == null) { - return HttpNotFound(); + return NotFound(); } - var uid = User.GetUserId(); - if (uid != circle.OwnerId) return this.HttpUnauthorized(); + var uid = User.FindFirstValue(ClaimTypes.NameIdentifier); + if (uid != circle.OwnerId) return Unauthorized(); return View(circle); } @@ -129,8 +128,8 @@ namespace Yavsc.Controllers public async Task DeleteConfirmed(long id) { Circle circle = await _context.Circle.SingleAsync(m => m.Id == id); - var uid = User.GetUserId(); - if (uid != circle.OwnerId) return this.HttpUnauthorized(); + var uid = User.FindFirstValue(ClaimTypes.NameIdentifier); + if (uid != circle.OwnerId) return Unauthorized(); _context.Circle.Remove(circle); await _context.SaveChangesAsync(uid); return RedirectToAction("Index"); diff --git a/src/Yavsc/Controllers/Communicating/CircleMembersController.cs b/src/Yavsc/Controllers/Communicating/CircleMembersController.cs index 48a50bf0..d532456b 100644 --- a/src/Yavsc/Controllers/Communicating/CircleMembersController.cs +++ b/src/Yavsc/Controllers/Communicating/CircleMembersController.cs @@ -1,9 +1,9 @@ -using System.Linq; + using System.Security.Claims; -using System.Threading.Tasks; -using Microsoft.AspNet.Mvc; -using Microsoft.AspNet.Mvc.Rendering; -using Microsoft.Data.Entity; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.Rendering; +using Microsoft.EntityFrameworkCore; +using Yavsc.Helpers; using Yavsc.Models; using Yavsc.Models.Relationship; @@ -21,7 +21,7 @@ namespace Yavsc.Controllers // GET: CircleMembers public async Task Index() { - var uid = User.GetUserId(); + var uid = User.FindFirstValue(ClaimTypes.NameIdentifier); var applicationDbContext = _context.CircleMembers.Include(c => c.Circle).Include(c => c.Member) .Where(c=>c.Circle.OwnerId == uid); return View(await applicationDbContext.ToListAsync()); @@ -30,14 +30,14 @@ namespace Yavsc.Controllers // GET: CircleMembers/Details/5 public async Task Details(long id) { - var uid = User.GetUserId(); + var uid = User.FindFirstValue(ClaimTypes.NameIdentifier); CircleMember circleMember = await _context.CircleMembers .Include(m=>m.Circle) .FirstOrDefaultAsync(c=>c.CircleId == id); if (circleMember == null) { - return HttpNotFound(); + return NotFound(); } return View(circleMember); @@ -46,7 +46,7 @@ namespace Yavsc.Controllers // GET: CircleMembers/Create public IActionResult Create() { - var uid = User.GetUserId(); + var uid = User.FindFirstValue(ClaimTypes.NameIdentifier); ViewBag.CircleId = new SelectList(_context.Circle.Where(c=>c.OwnerId == uid), "Id", "Name"); ViewBag.MemberId = new SelectList(_context.Users, "Id", "UserName"); return View(); @@ -57,7 +57,7 @@ namespace Yavsc.Controllers [ValidateAntiForgeryToken] public async Task Create(CircleMember circleMember) { - var uid = User.GetUserId(); + var uid = User.FindFirstValue(ClaimTypes.NameIdentifier); var circle = _context.Circle.SingleOrDefault(c=>c.OwnerId == uid && c.Id == circleMember.CircleId); if (circle==null) return new BadRequestResult(); @@ -76,13 +76,13 @@ namespace Yavsc.Controllers // GET: CircleMembers/Edit/5 public async Task Edit(long id) { - var uid = User.GetUserId(); + var uid = User.FindFirstValue(ClaimTypes.NameIdentifier); CircleMember circleMember = await _context.CircleMembers .Include(m=>m.Member) .SingleOrDefaultAsync(m => m.CircleId == id && m.MemberId == uid); if (circleMember == null) { - return HttpNotFound(); + return NotFound(); } return View(circleMember); } @@ -107,7 +107,7 @@ namespace Yavsc.Controllers [ActionName("Delete")] public async Task Delete(long id) { - var uid = User.GetUserId(); + var uid = User.FindFirstValue(ClaimTypes.NameIdentifier); CircleMember circleMember = await _context.CircleMembers .Include(m=>m.Circle) @@ -115,7 +115,7 @@ namespace Yavsc.Controllers .SingleOrDefaultAsync(m => m.CircleId == id && m.MemberId == uid); if (circleMember == null) { - return HttpNotFound(); + return NotFound(); } return View(circleMember); diff --git a/src/Yavsc/Controllers/Communicating/CommentsController.cs b/src/Yavsc/Controllers/Communicating/CommentsController.cs index ed6d2080..9475c429 100644 --- a/src/Yavsc/Controllers/Communicating/CommentsController.cs +++ b/src/Yavsc/Controllers/Communicating/CommentsController.cs @@ -1,8 +1,8 @@ -using System.Security.Claims; -using System.Threading.Tasks; -using Microsoft.AspNet.Mvc; -using Microsoft.AspNet.Mvc.Rendering; -using Microsoft.Data.Entity; + +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.Rendering; +using Microsoft.EntityFrameworkCore; +using Yavsc.Helpers; using Yavsc.Models; using Yavsc.Models.Blog; @@ -32,13 +32,13 @@ namespace Yavsc.Controllers { if (id == null) { - return HttpNotFound(); + return NotFound(); } Comment comment = await _context.Comment.SingleAsync(m => m.Id == id); if (comment == null) { - return HttpNotFound(); + return NotFound(); } return View(comment); @@ -73,13 +73,13 @@ namespace Yavsc.Controllers { if (id == null) { - return HttpNotFound(); + return NotFound(); } Comment comment = await _context.Comment.SingleAsync(m => m.Id == id); if (comment == null) { - return HttpNotFound(); + return NotFound(); } ViewData["PostId"] = new SelectList(_context.Blogspot, "Id", "Post", comment.PostId); return View(comment); @@ -106,13 +106,13 @@ namespace Yavsc.Controllers { if (id == null) { - return HttpNotFound(); + return NotFound(); } Comment comment = await _context.Comment.SingleAsync(m => m.Id == id); if (comment == null) { - return HttpNotFound(); + return NotFound(); } return View(comment); diff --git a/src/Yavsc/Controllers/Communicating/DevicesController.cs b/src/Yavsc/Controllers/Communicating/DevicesController.cs index 023eb27c..ba53a60c 100644 --- a/src/Yavsc/Controllers/Communicating/DevicesController.cs +++ b/src/Yavsc/Controllers/Communicating/DevicesController.cs @@ -1,13 +1,11 @@ -using System.Linq; -using System.Security.Claims; -using System.Threading.Tasks; +using System.Security.Claims; -using Microsoft.AspNet.Mvc; -using Microsoft.Data.Entity; +using Microsoft.AspNetCore.Mvc; namespace Yavsc.Controllers { + using Microsoft.EntityFrameworkCore; using Models; using Models.Identity; public class DevicesController : Controller @@ -22,7 +20,7 @@ namespace Yavsc.Controllers // GET: GCMDevices public async Task Index() { - var uid = User.GetUserId(); + var uid = User.FindFirstValue(ClaimTypes.NameIdentifier); var applicationDbContext = _context.DeviceDeclaration.Include(g => g.DeviceOwner).Where(d=>d.DeviceOwnerId == uid); return View(await applicationDbContext.ToListAsync()); @@ -33,13 +31,13 @@ namespace Yavsc.Controllers { if (id == null) { - return HttpNotFound(); + return NotFound(); } DeviceDeclaration googleCloudMobileDeclaration = await _context.DeviceDeclaration.SingleAsync(m => m.DeviceId == id); if (googleCloudMobileDeclaration == null) { - return HttpNotFound(); + return NotFound(); } return View(googleCloudMobileDeclaration); @@ -51,13 +49,13 @@ namespace Yavsc.Controllers { if (id == null) { - return HttpNotFound(); + return NotFound(); } DeviceDeclaration googleCloudMobileDeclaration = await _context.DeviceDeclaration.SingleAsync(m => m.DeviceId == id); if (googleCloudMobileDeclaration == null) { - return HttpNotFound(); + return NotFound(); } return View(googleCloudMobileDeclaration); diff --git a/src/Yavsc/Controllers/Communicating/HyperLinkController.cs b/src/Yavsc/Controllers/Communicating/HyperLinkController.cs index bf45059d..af9678a3 100644 --- a/src/Yavsc/Controllers/Communicating/HyperLinkController.cs +++ b/src/Yavsc/Controllers/Communicating/HyperLinkController.cs @@ -1,7 +1,6 @@ -using System.Threading.Tasks; -using Microsoft.AspNet.Authorization; -using Microsoft.AspNet.Mvc; -using Microsoft.Data.Entity; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; using Yavsc.Models; using Yavsc.Models.Relationship; @@ -28,13 +27,13 @@ namespace Yavsc.Controllers { if (href == null || method ==null) { - return HttpNotFound(); + return NotFound(); } HyperLink hyperLink = await _context.HyperLink.SingleAsync(m => m.HRef == href && m.Method == method); if (hyperLink == null) { - return HttpNotFound(); + return NotFound(); } return View(hyperLink); @@ -65,13 +64,13 @@ namespace Yavsc.Controllers { if (href == null || method ==null) { - return HttpNotFound(); + return NotFound(); } HyperLink hyperLink = await _context.HyperLink.SingleAsync(m => m.HRef == href && m.Method == method); if (hyperLink == null) { - return HttpNotFound(); + return NotFound(); } return View(hyperLink); } @@ -96,14 +95,14 @@ namespace Yavsc.Controllers { if (href == null || method ==null) { - return HttpNotFound(); + return NotFound(); } HyperLink hyperLink = await _context.HyperLink.SingleAsync(m => m.HRef == href && m.Method == method); if (hyperLink == null) { - return HttpNotFound(); + return NotFound(); } return View(hyperLink); @@ -116,7 +115,7 @@ namespace Yavsc.Controllers { if (HRef == null || Method ==null) { - return HttpNotFound(); + return NotFound(); } HyperLink hyperLink = await _context.HyperLink.SingleAsync(m => m.HRef == HRef && m.Method == Method); diff --git a/src/Yavsc/Controllers/Communicating/NotificationsController.cs b/src/Yavsc/Controllers/Communicating/NotificationsController.cs index 09a1acbf..e48733d5 100644 --- a/src/Yavsc/Controllers/Communicating/NotificationsController.cs +++ b/src/Yavsc/Controllers/Communicating/NotificationsController.cs @@ -1,7 +1,6 @@ -using System.Security.Claims; -using System.Threading.Tasks; -using Microsoft.AspNet.Mvc; -using Microsoft.Data.Entity; +using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; +using Yavsc.Helpers; using Yavsc.Models; using Yavsc.Models.Messaging; @@ -27,13 +26,13 @@ namespace Yavsc.Controllers { if (id == null) { - return HttpNotFound(); + return NotFound(); } Notification notification = await _context.Notification.SingleAsync(m => m.Id == id); if (notification == null) { - return HttpNotFound(); + return NotFound(); } return View(notification); @@ -64,13 +63,13 @@ namespace Yavsc.Controllers { if (id == null) { - return HttpNotFound(); + return NotFound(); } Notification notification = await _context.Notification.SingleAsync(m => m.Id == id); if (notification == null) { - return HttpNotFound(); + return NotFound(); } return View(notification); } @@ -95,13 +94,13 @@ namespace Yavsc.Controllers { if (id == null) { - return HttpNotFound(); + return NotFound(); } Notification notification = await _context.Notification.SingleAsync(m => m.Id == id); if (notification == null) { - return HttpNotFound(); + return NotFound(); } return View(notification); diff --git a/src/Yavsc/Controllers/Contracting/ActivityController.cs b/src/Yavsc/Controllers/Contracting/ActivityController.cs index aa5214c0..091d6cb2 100644 --- a/src/Yavsc/Controllers/Contracting/ActivityController.cs +++ b/src/Yavsc/Controllers/Contracting/ActivityController.cs @@ -1,17 +1,14 @@ -using System.Collections.Generic; -using System.Linq; -using Microsoft.AspNet.Authorization; -using Microsoft.AspNet.Mvc; -using Microsoft.AspNet.Mvc.Rendering; -using Microsoft.Data.Entity; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.Rendering; using Microsoft.Extensions.Localization; -using Microsoft.Extensions.Logging; namespace Yavsc.Controllers { - using System.Security.Claims; + using Microsoft.EntityFrameworkCore; using Models; using Models.Workflow; + using Yavsc.Helpers; [Authorize("AdministratorOnly")] public class ActivityController : Controller @@ -105,13 +102,13 @@ namespace Yavsc.Controllers { if (id == null) { - return HttpNotFound(); + return NotFound(); } Activity activity = _context.Activities.Single(m => m.Code == id); if (activity == null) { - return HttpNotFound(); + return NotFound(); } return View(activity); @@ -150,13 +147,13 @@ namespace Yavsc.Controllers { if (id == null) { - return HttpNotFound(); + return NotFound(); } Activity activity = _context.Activities.Single(m => m.Code == id); if (activity == null) { - return HttpNotFound(); + return NotFound(); } ViewBag.ParentCode = GetEligibleParent(id); SetSettingClasseInfo(); @@ -187,13 +184,13 @@ namespace Yavsc.Controllers { if (id == null) { - return HttpNotFound(); + return NotFound(); } Activity activity = _context.Activities.Single(m => m.Code == id); if (activity == null) { - return HttpNotFound(); + return NotFound(); } return View(activity); diff --git a/src/Yavsc/Controllers/Contracting/ClientController.cs b/src/Yavsc/Controllers/Contracting/ClientController.cs index f43eb166..10702f11 100644 --- a/src/Yavsc/Controllers/Contracting/ClientController.cs +++ b/src/Yavsc/Controllers/Contracting/ClientController.cs @@ -1,12 +1,9 @@ -using System; -using System.Threading.Tasks; -using Microsoft.AspNet.Mvc; -using Microsoft.AspNet.Mvc.Rendering; -using Microsoft.Data.Entity; -using System.Collections.Generic; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.Rendering; +using Microsoft.EntityFrameworkCore; +using Yavsc.Helpers; using Yavsc.Models; using Yavsc.Models.Auth; -using System.Security.Claims; namespace Yavsc.Controllers { @@ -30,13 +27,13 @@ namespace Yavsc.Controllers { if (id == null) { - return HttpNotFound(); + return NotFound(); } Client client = await _context.Applications.SingleAsync(m => m.Id == id); if (client == null) { - return HttpNotFound(); + return NotFound(); } return View(client); } @@ -81,13 +78,13 @@ namespace Yavsc.Controllers { if (id == null) { - return HttpNotFound(); + return NotFound(); } Client client = await _context.Applications.SingleAsync(m => m.Id == id); if (client == null) { - return HttpNotFound(); + return NotFound(); } SetAppTypesInputValues(); return View(client); @@ -113,13 +110,13 @@ namespace Yavsc.Controllers { if (id == null) { - return HttpNotFound(); + return NotFound(); } Client client = await _context.Applications.SingleAsync(m => m.Id == id); if (client == null) { - return HttpNotFound(); + return NotFound(); } return View(client); diff --git a/src/Yavsc/Controllers/Contracting/CoWorkingController.cs b/src/Yavsc/Controllers/Contracting/CoWorkingController.cs index 905ea0ce..3e0eeeb5 100644 --- a/src/Yavsc/Controllers/Contracting/CoWorkingController.cs +++ b/src/Yavsc/Controllers/Contracting/CoWorkingController.cs @@ -1,9 +1,7 @@ -using System.Linq; -using System.Security.Claims; -using System.Threading.Tasks; -using Microsoft.AspNet.Mvc; -using Microsoft.AspNet.Mvc.Rendering; -using Microsoft.Data.Entity; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.Rendering; +using Microsoft.EntityFrameworkCore; +using Yavsc.Helpers; using Yavsc.Models; using Yavsc.Models.Workflow; @@ -30,13 +28,13 @@ namespace Yavsc.Controllers { if (id == null) { - return HttpNotFound(); + return NotFound(); } CoWorking coWorking = await _context.CoWorking.SingleAsync(m => m.Id == id); if (coWorking == null) { - return HttpNotFound(); + return NotFound(); } return View(coWorking); @@ -71,13 +69,13 @@ namespace Yavsc.Controllers { if (id == null) { - return HttpNotFound(); + return NotFound(); } CoWorking coWorking = await _context.CoWorking.SingleAsync(m => m.Id == id); if (coWorking == null) { - return HttpNotFound(); + return NotFound(); } ViewData["PerformerId"] = new SelectList(_context.Performers, "PerformerId", "Performer", coWorking.PerformerId); ViewData["WorkingForId"] = new SelectList(_context.Users, "Id", "WorkingFor", coWorking.WorkingForId); @@ -106,13 +104,13 @@ namespace Yavsc.Controllers { if (id == null) { - return HttpNotFound(); + return NotFound(); } CoWorking coWorking = await _context.CoWorking.SingleAsync(m => m.Id == id); if (coWorking == null) { - return HttpNotFound(); + return NotFound(); } return View(coWorking); diff --git a/src/Yavsc/Controllers/Contracting/CommandController.cs b/src/Yavsc/Controllers/Contracting/CommandController.cs index 32375680..cee83971 100644 --- a/src/Yavsc/Controllers/Contracting/CommandController.cs +++ b/src/Yavsc/Controllers/Contracting/CommandController.cs @@ -1,18 +1,14 @@ -using System; -using System.Linq; using System.Security.Claims; -using System.Threading.Tasks; -using Microsoft.AspNet.Authorization; -using Microsoft.AspNet.Identity; -using Microsoft.AspNet.Mvc; -using Microsoft.Data.Entity; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Identity; +using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Localization; -using Microsoft.Extensions.Logging; -using Microsoft.Extensions.OptionsModel; namespace Yavsc.Controllers { using Helpers; + using Microsoft.EntityFrameworkCore; + using Microsoft.Extensions.Options; using Models; using Models.Google.Messaging; using Models.Relationship; @@ -58,7 +54,7 @@ namespace Yavsc.Controllers [Authorize] public virtual async Task Index() { - var uid = User.GetUserId(); + var uid = User.FindFirstValue(ClaimTypes.NameIdentifier); return View(await _context.RdvQueries .Include(x => x.Client) .Include(x => x.PerformerProfile) @@ -77,7 +73,7 @@ namespace Yavsc.Controllers .SingleAsync(m => m.Id == id); if (command == null) { - return HttpNotFound(); + return NotFound(); } return View(command); @@ -105,7 +101,7 @@ namespace Yavsc.Controllers x => x.PerformerId == proId ); if (pro == null) - return HttpNotFound(); + return NotFound(); ViewBag.Activity = _context.Activities.FirstOrDefault(a => a.Code == activityCode); ViewBag.GoogleSettings = _googleSettings; var userid = User.GetUserId(); @@ -126,7 +122,7 @@ namespace Yavsc.Controllers public async Task Create(RdvQuery command) { // TODO validate BillingCode value - var uid = User.GetUserId(); + var uid = User.FindFirstValue(ClaimTypes.NameIdentifier); var prid = command.PerformerId; if (string.IsNullOrWhiteSpace(uid) || string.IsNullOrWhiteSpace(prid)) @@ -156,7 +152,7 @@ namespace Yavsc.Controllers command.Location = existingLocation; } else _context.Attach(command.Location); - _context.RdvQueries.Add(command, GraphBehavior.IncludeDependents); + _context.RdvQueries.Add(command); _context.SaveChanges(User.GetUserId()); var yaev = command.CreateEvent("NewCommand"); @@ -213,13 +209,13 @@ namespace Yavsc.Controllers { if (id == null) { - return HttpNotFound(); + return NotFound(); } RdvQuery command = _context.RdvQueries.Single(m => m.Id == id); if (command == null) { - return HttpNotFound(); + return NotFound(); } return View(command); } @@ -244,13 +240,13 @@ namespace Yavsc.Controllers { if (id == null) { - return HttpNotFound(); + return NotFound(); } RdvQuery command = _context.RdvQueries.Single(m => m.Id == id); if (command == null) { - return HttpNotFound(); + return NotFound(); } return View(command); diff --git a/src/Yavsc/Controllers/Contracting/CommandFormsController.cs b/src/Yavsc/Controllers/Contracting/CommandFormsController.cs index d0f03df8..851d4fec 100644 --- a/src/Yavsc/Controllers/Contracting/CommandFormsController.cs +++ b/src/Yavsc/Controllers/Contracting/CommandFormsController.cs @@ -1,9 +1,7 @@ -using System.Linq; -using System.Security.Claims; -using System.Threading.Tasks; -using Microsoft.AspNet.Mvc; -using Microsoft.AspNet.Mvc.Rendering; -using Microsoft.Data.Entity; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.Rendering; +using Microsoft.EntityFrameworkCore; +using Yavsc.Helpers; using Yavsc.Models; using Yavsc.Models.Workflow; @@ -30,13 +28,13 @@ namespace Yavsc.Controllers { if (id == null) { - return HttpNotFound(); + return NotFound(); } CommandForm commandForm = await _context.CommandForm.SingleAsync(m => m.Id == id); if (commandForm == null) { - return HttpNotFound(); + return NotFound(); } return View(commandForm); @@ -73,13 +71,13 @@ namespace Yavsc.Controllers { if (id == null) { - return HttpNotFound(); + return NotFound(); } CommandForm commandForm = await _context.CommandForm.SingleAsync(m => m.Id == id); if (commandForm == null) { - return HttpNotFound(); + return NotFound(); } SetViewBag(commandForm); return View(commandForm); @@ -106,13 +104,13 @@ namespace Yavsc.Controllers { if (id == null) { - return HttpNotFound(); + return NotFound(); } CommandForm commandForm = await _context.CommandForm.SingleAsync(m => m.Id == id); if (commandForm == null) { - return HttpNotFound(); + return NotFound(); } return View(commandForm); diff --git a/src/Yavsc/Controllers/Contracting/DjSettingsController.cs b/src/Yavsc/Controllers/Contracting/DjSettingsController.cs index 35e82851..5e78ccae 100644 --- a/src/Yavsc/Controllers/Contracting/DjSettingsController.cs +++ b/src/Yavsc/Controllers/Contracting/DjSettingsController.cs @@ -1,6 +1,5 @@ -using System.Threading.Tasks; -using Microsoft.AspNet.Mvc; -using Microsoft.Data.Entity; +using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; using Yavsc.Models; using Yavsc.Models.Musical.Profiles; @@ -26,13 +25,13 @@ namespace Yavsc.Controllers { if (id == null) { - return HttpNotFound(); + return NotFound(); } DjSettings djSettings = await _context.DjSettings.SingleAsync(m => m.UserId == id); if (djSettings == null) { - return HttpNotFound(); + return NotFound(); } return View(djSettings); @@ -63,13 +62,13 @@ namespace Yavsc.Controllers { if (id == null) { - return HttpNotFound(); + return NotFound(); } DjSettings djSettings = await _context.DjSettings.SingleAsync(m => m.UserId == id); if (djSettings == null) { - return HttpNotFound(); + return NotFound(); } return View(djSettings); } @@ -94,13 +93,13 @@ namespace Yavsc.Controllers { if (id == null) { - return HttpNotFound(); + return NotFound(); } DjSettings djSettings = await _context.DjSettings.SingleAsync(m => m.UserId == id); if (djSettings == null) { - return HttpNotFound(); + return NotFound(); } return View(djSettings); diff --git a/src/Yavsc/Controllers/Contracting/DoController.cs b/src/Yavsc/Controllers/Contracting/DoController.cs index e01ca8da..01b33638 100644 --- a/src/Yavsc/Controllers/Contracting/DoController.cs +++ b/src/Yavsc/Controllers/Contracting/DoController.cs @@ -1,9 +1,7 @@ -using System.Linq; using System.Security.Claims; -using Microsoft.AspNet.Authorization; -using Microsoft.AspNet.Mvc; -using Microsoft.AspNet.Mvc.Rendering; -using Microsoft.Data.Entity; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.Rendering; namespace Yavsc.Controllers { @@ -13,6 +11,8 @@ namespace Yavsc.Controllers using Yavsc.ViewModels.Workflow; using Yavsc.Services; using System.Threading.Tasks; + using Yavsc.Helpers; + using Microsoft.EntityFrameworkCore; [Authorize] public class DoController : Controller @@ -49,14 +49,14 @@ namespace Yavsc.Controllers if (id == null || activityCode == null) { - return HttpNotFound(); + return NotFound(); } UserActivity userActivity = dbContext.UserActivities.Include(m=>m.Does) .Include(m=>m.User).Single(m => m.DoesCode == activityCode && m.UserId == id); if (userActivity == null) { - return HttpNotFound(); + return NotFound(); } bool hasConfigurableSettings = (userActivity.Does.SettingsClassName != null); var settings = await billing.GetPerformerSettingsAsync(activityCode,id); @@ -88,7 +88,7 @@ namespace Yavsc.Controllers [ValidateAntiForgeryToken] public IActionResult Create(UserActivity userActivity) { - var uid = User.GetUserId(); + var uid = User.FindFirstValue(ClaimTypes.NameIdentifier); if (!User.IsInRole("Administrator")) if (uid != userActivity.UserId) ModelState.AddModelError("User","You're not admin."); @@ -110,7 +110,7 @@ namespace Yavsc.Controllers { if (id == null) { - return HttpNotFound(); + return NotFound(); } UserActivity userActivity = dbContext.UserActivities.Include( @@ -120,7 +120,7 @@ namespace Yavsc.Controllers ).Single(m => m.DoesCode == activityCode && m.UserId == id); if (userActivity == null) { - return HttpNotFound(); + return NotFound(); } ViewData["DoesCode"] = new SelectList(dbContext.Activities, "Code", "Does", userActivity.DoesCode); ViewData["UserId"] = new SelectList(dbContext.Performers, "PerformerId", "User", userActivity.UserId); @@ -152,14 +152,14 @@ namespace Yavsc.Controllers { if (id == null) { - return HttpNotFound(); + return NotFound(); } UserActivity userActivity = dbContext.UserActivities.Single(m => m.UserId == id && m.DoesCode == activityCode); if (userActivity == null) { - return HttpNotFound(); + return NotFound(); } if (!User.IsInRole("Administrator")) if (User.GetUserId() != userActivity.UserId) diff --git a/src/Yavsc/Controllers/Contracting/EstimateController.cs b/src/Yavsc/Controllers/Contracting/EstimateController.cs index 3555ab71..b36d5ea4 100644 --- a/src/Yavsc/Controllers/Contracting/EstimateController.cs +++ b/src/Yavsc/Controllers/Contracting/EstimateController.cs @@ -1,18 +1,13 @@ -using System.Collections.Generic; -using System.IO; -using System.Linq; using System.Net.Mime; using System.Security.Claims; -using System.Threading.Tasks; -using Microsoft.AspNet.Authorization; -using Microsoft.AspNet.Http; -using Microsoft.AspNet.Mvc; -using Microsoft.Data.Entity; -using Microsoft.Extensions.OptionsModel; - using Yavsc.Helpers; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Yavsc.Helpers; namespace Yavsc.Controllers { + using Microsoft.EntityFrameworkCore; + using Microsoft.Extensions.Options; using Models; using Models.Billing; using Models.Workflow; @@ -36,7 +31,7 @@ namespace Yavsc.Controllers public IActionResult Index() { - var uid = User.GetUserId(); + var uid = User.FindFirstValue(ClaimTypes.NameIdentifier); return View(_context.Estimates.Include(e=>e.Query) .Include(e=>e.Query.PerformerProfile) .Include(e=>e.Query.PerformerProfile.Performer) @@ -49,10 +44,10 @@ namespace Yavsc.Controllers // GET: Estimate/Details/5 public async Task Details(long? id) { - var uid = User.GetUserId(); + var uid = User.FindFirstValue(ClaimTypes.NameIdentifier); if (id == null) { - return HttpNotFound(); + return NotFound(); } Estimate estimate = _context.Estimates @@ -66,9 +61,9 @@ namespace Yavsc.Controllers .Single(m => m.Id == id); if (estimate == null) { - return HttpNotFound(); + return NotFound(); } - if (!await authorizationService.AuthorizeAsync(User, estimate, new ViewRequirement())) + if (authorizationService.AuthorizeAsync(User, estimate, new ViewRequirement()).IsFaulted) { return new ChallengeResult(); } @@ -80,7 +75,7 @@ namespace Yavsc.Controllers [Authorize] public IActionResult Create() { - var uid = User.GetUserId(); + var uid = User.FindFirstValue(ClaimTypes.NameIdentifier); IQueryable queries = _context.RdvQueries.Include(q=>q.Location).Where(bq=>bq.PerformerId == uid); //.Select(bq=>new SelectListItem{ Text = bq.Client.UserName, Value = bq.Client.Id }); ViewBag.Clients = queries.Select(q=>q.Client).Distinct(); @@ -147,15 +142,15 @@ namespace Yavsc.Controllers { if (id == null) { - return HttpNotFound(); + return NotFound(); } - var uid = User.GetUserId(); + var uid = User.FindFirstValue(ClaimTypes.NameIdentifier); Estimate estimate = _context.Estimates .Where(e=>e.OwnerId==uid||e.ClientId==uid).Single(m => m.Id == id); if (estimate == null) { - return HttpNotFound(); + return NotFound(); } ViewBag.Files = Yavsc.Helpers.FileSystemHelpers.GetFileName(null); @@ -170,9 +165,9 @@ namespace Yavsc.Controllers [ValidateAntiForgeryToken] public IActionResult Edit(Estimate estimate) { - var uid = User.GetUserId(); + var uid = User.FindFirstValue(ClaimTypes.NameIdentifier); if (estimate.OwnerId!=uid&&estimate.ClientId!=uid - ) return new HttpNotFoundResult(); + ) return NotFound(); if (ModelState.IsValid) { _context.Update(estimate); @@ -188,15 +183,15 @@ namespace Yavsc.Controllers { if (id == null) { - return HttpNotFound(); + return NotFound(); } - var uid = User.GetUserId(); + var uid = User.FindFirstValue(ClaimTypes.NameIdentifier); Estimate estimate = _context.Estimates .Where(e=>e.OwnerId==uid||e.ClientId==uid) .Single(m => m.Id == id); if (estimate == null) { - return HttpNotFound(); + return NotFound(); } return View(estimate); diff --git a/src/Yavsc/Controllers/Contracting/FormsController.cs b/src/Yavsc/Controllers/Contracting/FormsController.cs index 62dafd53..6aff0418 100644 --- a/src/Yavsc/Controllers/Contracting/FormsController.cs +++ b/src/Yavsc/Controllers/Contracting/FormsController.cs @@ -1,7 +1,6 @@ -using System.Security.Claims; -using System.Threading.Tasks; -using Microsoft.AspNet.Mvc; -using Microsoft.Data.Entity; +using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; +using Yavsc.Helpers; using Yavsc.Models; using Yavsc.Models.Forms; @@ -27,13 +26,13 @@ namespace Yavsc.Controllers { if (id == null) { - return HttpNotFound(); + return NotFound(); } Form form = await _context.Form.SingleAsync(m => m.Id == id); if (form == null) { - return HttpNotFound(); + return NotFound(); } return View(form); @@ -64,13 +63,13 @@ namespace Yavsc.Controllers { if (id == null) { - return HttpNotFound(); + return NotFound(); } Form form = await _context.Form.SingleAsync(m => m.Id == id); if (form == null) { - return HttpNotFound(); + return NotFound(); } return View(form); } @@ -95,13 +94,13 @@ namespace Yavsc.Controllers { if (id == null) { - return HttpNotFound(); + return NotFound(); } Form form = await _context.Form.SingleAsync(m => m.Id == id); if (form == null) { - return HttpNotFound(); + return NotFound(); } return View(form); diff --git a/src/Yavsc/Controllers/Contracting/FrontOfficeController.cs b/src/Yavsc/Controllers/Contracting/FrontOfficeController.cs index 9e8be648..59156051 100644 --- a/src/Yavsc/Controllers/Contracting/FrontOfficeController.cs +++ b/src/Yavsc/Controllers/Contracting/FrontOfficeController.cs @@ -1,19 +1,15 @@ -using Microsoft.AspNet.Mvc; -using Microsoft.AspNet.Authorization; -using Microsoft.AspNet.Identity; -using Microsoft.Data.Entity; -using Microsoft.Extensions.Logging; -using System; -using System.Linq; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Identity; using System.Security.Claims; namespace Yavsc.Controllers { using Helpers; + using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Localization; using Models; using ViewModels.FrontOffice; - using Yavsc.Abstract.FileSystem; using Yavsc.Services; public class FrontOfficeController : Controller @@ -38,7 +34,7 @@ namespace Yavsc.Controllers } public ActionResult Index() { - var uid = User.GetUserId(); + var uid = User.FindFirstValue(ClaimTypes.NameIdentifier); var now = DateTime.Now; var model = new FrontOfficeIndexViewModel diff --git a/src/Yavsc/Controllers/Contracting/GeneralSettingsController.cs b/src/Yavsc/Controllers/Contracting/GeneralSettingsController.cs index 0fb778d4..446cda01 100644 --- a/src/Yavsc/Controllers/Contracting/GeneralSettingsController.cs +++ b/src/Yavsc/Controllers/Contracting/GeneralSettingsController.cs @@ -1,6 +1,5 @@ -using System.Threading.Tasks; -using Microsoft.AspNet.Mvc; -using Microsoft.Data.Entity; +using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; using Yavsc.Models; using Yavsc.Models.Musical.Profiles; @@ -26,13 +25,13 @@ namespace Yavsc.Controllers { if (id == null) { - return HttpNotFound(); + return NotFound(); } GeneralSettings generalSettings = await _context.GeneralSettings.SingleAsync(m => m.UserId == id); if (generalSettings == null) { - return HttpNotFound(); + return NotFound(); } return View(generalSettings); @@ -63,13 +62,13 @@ namespace Yavsc.Controllers { if (id == null) { - return HttpNotFound(); + return NotFound(); } GeneralSettings generalSettings = await _context.GeneralSettings.SingleAsync(m => m.UserId == id); if (generalSettings == null) { - return HttpNotFound(); + return NotFound(); } return View(generalSettings); } @@ -94,13 +93,13 @@ namespace Yavsc.Controllers { if (id == null) { - return HttpNotFound(); + return NotFound(); } GeneralSettings generalSettings = await _context.GeneralSettings.SingleAsync(m => m.UserId == id); if (generalSettings == null) { - return HttpNotFound(); + return NotFound(); } return View(generalSettings); diff --git a/src/Yavsc/Controllers/Contracting/MusicalTendenciesController.cs b/src/Yavsc/Controllers/Contracting/MusicalTendenciesController.cs index 7f11523e..198e3177 100644 --- a/src/Yavsc/Controllers/Contracting/MusicalTendenciesController.cs +++ b/src/Yavsc/Controllers/Contracting/MusicalTendenciesController.cs @@ -1,11 +1,11 @@ -using System.Linq; -using Microsoft.AspNet.Mvc; +using Microsoft.AspNetCore.Mvc; namespace Yavsc.Controllers { - using System.Security.Claims; using Models; using Models.Musical; + using Yavsc.Helpers; + public class MusicalTendenciesController : Controller { private readonly ApplicationDbContext _context; @@ -26,13 +26,13 @@ namespace Yavsc.Controllers { if (id == null) { - return HttpNotFound(); + return NotFound(); } MusicalTendency musicalTendency = _context.MusicalTendency.Single(m => m.Id == id); if (musicalTendency == null) { - return HttpNotFound(); + return NotFound(); } return View(musicalTendency); @@ -63,13 +63,13 @@ namespace Yavsc.Controllers { if (id == null) { - return HttpNotFound(); + return NotFound(); } MusicalTendency musicalTendency = _context.MusicalTendency.Single(m => m.Id == id); if (musicalTendency == null) { - return HttpNotFound(); + return NotFound(); } return View(musicalTendency); } @@ -94,13 +94,13 @@ namespace Yavsc.Controllers { if (id == null) { - return HttpNotFound(); + return NotFound(); } MusicalTendency musicalTendency = _context.MusicalTendency.Single(m => m.Id == id); if (musicalTendency == null) { - return HttpNotFound(); + return NotFound(); } return View(musicalTendency); diff --git a/src/Yavsc/Controllers/Contracting/SIRENExceptionsController.cs b/src/Yavsc/Controllers/Contracting/SIRENExceptionsController.cs index bf8efc83..64338f9a 100644 --- a/src/Yavsc/Controllers/Contracting/SIRENExceptionsController.cs +++ b/src/Yavsc/Controllers/Contracting/SIRENExceptionsController.cs @@ -1,7 +1,6 @@ -using System.Linq; -using System.Security.Claims; -using Microsoft.AspNet.Authorization; -using Microsoft.AspNet.Mvc; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Yavsc.Helpers; using Yavsc.Models; using Yavsc.Models.Billing; @@ -28,13 +27,13 @@ namespace Yavsc.Controllers { if (id == null) { - return HttpNotFound(); + return NotFound(); } ExceptionSIREN exceptionSIREN = _context.ExceptionsSIREN.Single(m => m.SIREN == id); if (exceptionSIREN == null) { - return HttpNotFound(); + return NotFound(); } return View(exceptionSIREN); @@ -65,13 +64,13 @@ namespace Yavsc.Controllers { if (id == null) { - return HttpNotFound(); + return NotFound(); } ExceptionSIREN exceptionSIREN = _context.ExceptionsSIREN.Single(m => m.SIREN == id); if (exceptionSIREN == null) { - return HttpNotFound(); + return NotFound(); } return View(exceptionSIREN); } @@ -96,13 +95,13 @@ namespace Yavsc.Controllers { if (id == null) { - return HttpNotFound(); + return NotFound(); } ExceptionSIREN exceptionSIREN = _context.ExceptionsSIREN.Single(m => m.SIREN == id); if (exceptionSIREN == null) { - return HttpNotFound(); + return NotFound(); } return View(exceptionSIREN); diff --git a/src/Yavsc/Controllers/FileSystemController.cs b/src/Yavsc/Controllers/FileSystemController.cs index 96eaf210..a3ab4616 100644 --- a/src/Yavsc/Controllers/FileSystemController.cs +++ b/src/Yavsc/Controllers/FileSystemController.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNet.Mvc; +using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Logging; using Yavsc.Helpers; diff --git a/src/Yavsc/Controllers/Generic/SettingsController.cs b/src/Yavsc/Controllers/Generic/SettingsController.cs index a3fa9840..9f7450f3 100644 --- a/src/Yavsc/Controllers/Generic/SettingsController.cs +++ b/src/Yavsc/Controllers/Generic/SettingsController.cs @@ -1,13 +1,12 @@ -using System.Security.Claims; -using System.Threading.Tasks; -using Microsoft.AspNet.Authorization; -using Microsoft.AspNet.Mvc; -using Microsoft.Data.Entity; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; namespace Yavsc.Controllers.Generic { using System.Linq; + using Microsoft.EntityFrameworkCore; using Models; + using Yavsc.Helpers; using Yavsc.Services; [Authorize] @@ -48,7 +47,7 @@ namespace Yavsc.Controllers.Generic var profile = await Settings.SingleAsync(m => m.UserId == id); if (profile == null) { - return HttpNotFound(); + return NotFound(); } return View(profile); @@ -85,13 +84,13 @@ namespace Yavsc.Controllers.Generic { if (id == null) { - return HttpNotFound(); + return NotFound(); } var brusherProfile = await Settings.SingleAsync(m => m.UserId == id); if (brusherProfile == null) { - return HttpNotFound(); + return NotFound(); } return View(brusherProfile); diff --git a/src/Yavsc/Controllers/Haircut/BrusherProfileController.cs b/src/Yavsc/Controllers/Haircut/BrusherProfileController.cs index d8874cc8..f63ac742 100644 --- a/src/Yavsc/Controllers/Haircut/BrusherProfileController.cs +++ b/src/Yavsc/Controllers/Haircut/BrusherProfileController.cs @@ -1,6 +1,6 @@ using Yavsc.Models; using Yavsc.Models.Haircut; -using Microsoft.AspNet.Authorization; +using Microsoft.AspNetCore.Authorization; using Yavsc.Controllers.Generic; namespace Yavsc.Controllers diff --git a/src/Yavsc/Controllers/Haircut/ColorsController.cs b/src/Yavsc/Controllers/Haircut/ColorsController.cs index 0b4606e1..06ff3ba8 100644 --- a/src/Yavsc/Controllers/Haircut/ColorsController.cs +++ b/src/Yavsc/Controllers/Haircut/ColorsController.cs @@ -1,7 +1,6 @@ -using System.Security.Claims; -using System.Threading.Tasks; -using Microsoft.AspNet.Mvc; -using Microsoft.Data.Entity; +using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; +using Yavsc.Helpers; using Yavsc.Models; using Yavsc.Models.Drawing; @@ -27,13 +26,13 @@ namespace Yavsc.Controllers { if (id == null) { - return HttpNotFound(); + return NotFound(); } Color color = await _context.Color.SingleAsync(m => m.Id == id); if (color == null) { - return HttpNotFound(); + return NotFound(); } return View(color); @@ -64,13 +63,13 @@ namespace Yavsc.Controllers { if (id == null) { - return HttpNotFound(); + return NotFound(); } Color color = await _context.Color.SingleAsync(m => m.Id == id); if (color == null) { - return HttpNotFound(); + return NotFound(); } return View(color); } @@ -95,13 +94,13 @@ namespace Yavsc.Controllers { if (id == null) { - return HttpNotFound(); + return NotFound(); } Color color = await _context.Color.SingleAsync(m => m.Id == id); if (color == null) { - return HttpNotFound(); + return NotFound(); } return View(color); diff --git a/src/Yavsc/Controllers/Haircut/HairCutCommandController.cs b/src/Yavsc/Controllers/Haircut/HairCutCommandController.cs index f5e787be..837acae4 100644 --- a/src/Yavsc/Controllers/Haircut/HairCutCommandController.cs +++ b/src/Yavsc/Controllers/Haircut/HairCutCommandController.cs @@ -1,14 +1,8 @@ -using System; -using System.Linq; using System.Security.Claims; -using System.Threading.Tasks; -using Microsoft.AspNet.Authorization; -using Microsoft.AspNet.Identity; -using Microsoft.AspNet.Mvc; -using Microsoft.Data.Entity; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Identity; +using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Localization; -using Microsoft.Extensions.Logging; -using Microsoft.Extensions.OptionsModel; namespace Yavsc.Controllers { @@ -18,14 +12,16 @@ namespace Yavsc.Controllers using Yavsc.Models.Relationship; using Yavsc.Services; using Newtonsoft.Json; - using Microsoft.AspNet.Http; + using Microsoft.AspNetCore.Http; using Yavsc.Extensions; using Yavsc.Models.Haircut; using System.Globalization; - using Microsoft.AspNet.Mvc.Rendering; + using Microsoft.AspNetCore.Mvc.Rendering; using System.Collections.Generic; using Yavsc.Models.Messaging; using PayPal.PayPalAPIInterfaceService.Model; + using Microsoft.Extensions.Options; + using Microsoft.EntityFrameworkCore; public class HairCutCommandController : CommandController { @@ -65,7 +61,7 @@ namespace Yavsc.Controllers HairCutQuery command = await GetQuery(id); if (command == null) { - return HttpNotFound(); + return NotFound(); } SetViewBagPaymentUrls(id); return View(command); @@ -75,7 +71,7 @@ namespace Yavsc.Controllers HairCutQuery command = await GetQuery(id); if (command == null) { - return HttpNotFound(); + return NotFound(); } var paymentInfo = await _context.ConfirmPayment(User.GetUserId(), PayerID, token); ViewData["paymentinfo"] = paymentInfo; @@ -139,9 +135,9 @@ namespace Yavsc.Controllers { var query = await GetQuery(id); if (query == null) { - return HttpNotFound(); + return NotFound(); } - var uid = User.GetUserId(); + var uid = User.FindFirstValue(ClaimTypes.NameIdentifier); if (query.ClientId != uid) return new ChallengeResult(); _context.HairCutQueries.Remove(query); @@ -154,7 +150,7 @@ namespace Yavsc.Controllers /// public override async Task Index() { - var uid = User.GetUserId(); + var uid = User.FindFirstValue(ClaimTypes.NameIdentifier); return View("Index", await _context.HairCutQueries .Include(x => x.Client) .Include(x => x.PerformerProfile) @@ -175,7 +171,7 @@ namespace Yavsc.Controllers .SingleOrDefaultAsync(m => m.Id == id); if (command == null) { - return HttpNotFound(); + return NotFound(); } SetViewBagPaymentUrls(id); return View(command); @@ -194,7 +190,7 @@ namespace Yavsc.Controllers public async Task CreateHairCutQuery(HairCutQuery model, string taintIds) { // TODO utiliser Markdown-av+tags - var uid = User.GetUserId(); + var uid = User.FindFirstValue(ClaimTypes.NameIdentifier); model.ClientId = uid; var prid = model.PerformerId; @@ -335,7 +331,7 @@ namespace Yavsc.Controllers pPrestation = new HairPrestation { }; } - var uid = User.GetUserId(); + var uid = User.FindFirstValue(ClaimTypes.NameIdentifier); var user = await _userManager.FindByIdAsync(uid); SetViewData(activityCode, performerId, pPrestation); @@ -381,7 +377,7 @@ namespace Yavsc.Controllers [ValidateAntiForgeryToken] public async Task CreateHairMultiCutQuery(HairMultiCutQuery command) { - var uid = User.GetUserId(); + var uid = User.FindFirstValue(ClaimTypes.NameIdentifier); var prid = command.PerformerId; if (string.IsNullOrWhiteSpace(uid) || string.IsNullOrWhiteSpace(prid)) @@ -415,7 +411,7 @@ namespace Yavsc.Controllers } else _context.Attach(command.Location); - _context.HairMultiCutQueries.Add(command, GraphBehavior.IncludeDependents); + _context.HairMultiCutQueries.Add(command); _context.SaveChanges(User.GetUserId()); var brSettings = await _context.BrusherProfile.SingleAsync( bp => bp.UserId == command.PerformerId diff --git a/src/Yavsc/Controllers/Haircut/HairPrestationsController.cs b/src/Yavsc/Controllers/Haircut/HairPrestationsController.cs index 21df3da0..83f104ae 100644 --- a/src/Yavsc/Controllers/Haircut/HairPrestationsController.cs +++ b/src/Yavsc/Controllers/Haircut/HairPrestationsController.cs @@ -1,6 +1,5 @@ -using System.Threading.Tasks; -using Microsoft.AspNet.Mvc; -using Microsoft.Data.Entity; +using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; using Yavsc.Models; using Yavsc.Models.Haircut; @@ -26,13 +25,13 @@ namespace Yavsc.Controllers { if (id == null) { - return HttpNotFound(); + return NotFound(); } HairPrestation hairPrestation = await _context.HairPrestation.SingleAsync(m => m.Id == id); if (hairPrestation == null) { - return HttpNotFound(); + return NotFound(); } return View(hairPrestation); @@ -63,13 +62,13 @@ namespace Yavsc.Controllers { if (id == null) { - return HttpNotFound(); + return NotFound(); } HairPrestation hairPrestation = await _context.HairPrestation.SingleAsync(m => m.Id == id); if (hairPrestation == null) { - return HttpNotFound(); + return NotFound(); } return View(hairPrestation); } @@ -94,13 +93,13 @@ namespace Yavsc.Controllers { if (id == null) { - return HttpNotFound(); + return NotFound(); } HairPrestation hairPrestation = await _context.HairPrestation.SingleAsync(m => m.Id == id); if (hairPrestation == null) { - return HttpNotFound(); + return NotFound(); } return View(hairPrestation); diff --git a/src/Yavsc/Controllers/Haircut/HairTaintsController.cs b/src/Yavsc/Controllers/Haircut/HairTaintsController.cs index 01537a81..c3662f69 100644 --- a/src/Yavsc/Controllers/Haircut/HairTaintsController.cs +++ b/src/Yavsc/Controllers/Haircut/HairTaintsController.cs @@ -1,9 +1,8 @@ -using System.Security.Claims; -using System.Threading.Tasks; -using Microsoft.AspNet.Authorization; -using Microsoft.AspNet.Mvc; -using Microsoft.AspNet.Mvc.Rendering; -using Microsoft.Data.Entity; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.Rendering; +using Microsoft.EntityFrameworkCore; +using Yavsc.Helpers; using Yavsc.Models; using Yavsc.Models.Haircut; @@ -31,13 +30,13 @@ namespace Yavsc.Controllers { if (id == null) { - return HttpNotFound(); + return NotFound(); } HairTaint hairTaint = await _context.HairTaint.SingleAsync(m => m.Id == id); if (hairTaint == null) { - return HttpNotFound(); + return NotFound(); } return View(hairTaint); @@ -70,13 +69,13 @@ namespace Yavsc.Controllers { if (id == null) { - return HttpNotFound(); + return NotFound(); } HairTaint hairTaint = await _context.HairTaint.SingleAsync(m => m.Id == id); if (hairTaint == null) { - return HttpNotFound(); + return NotFound(); } ViewBag.ColorId = new SelectList(_context.Color, "Id", "Name",hairTaint.ColorId); return View(hairTaint); @@ -103,13 +102,13 @@ namespace Yavsc.Controllers { if (id == null) { - return HttpNotFound(); + return NotFound(); } HairTaint hairTaint = await _context.HairTaint.SingleAsync(m => m.Id == id); if (hairTaint == null) { - return HttpNotFound(); + return NotFound(); } return View(hairTaint); diff --git a/src/Yavsc/Controllers/HomeController.cs b/src/Yavsc/Controllers/HomeController.cs index 90dc0fb0..ddf01adb 100644 --- a/src/Yavsc/Controllers/HomeController.cs +++ b/src/Yavsc/Controllers/HomeController.cs @@ -1,135 +1,31 @@ -using Microsoft.AspNet.Mvc.Localization; -using Microsoft.AspNet.Mvc; -using Microsoft.AspNet.Http.Features; -using Microsoft.AspNet.Diagnostics; -using Microsoft.AspNet.Authorization; -using Microsoft.AspNet.Hosting; -using Microsoft.AspNet.Identity; -using System.Linq; -using System.Security.Claims; -using Microsoft.Data.Entity; -using Microsoft.AspNet.Http; -using System.Threading.Tasks; +using System.Diagnostics; +using Microsoft.AspNetCore.Mvc; +using Yavsc.Models; -namespace Yavsc.Controllers +namespace Yavsc.Controllers; + +public class HomeController : Controller { - using System.IO; - using Models; - using Yavsc; - using Yavsc.Helpers; + private readonly ILogger _logger; - [AllowAnonymous] - public class HomeController : Controller + public HomeController(ILogger logger) { - readonly ApplicationDbContext _dbContext; - - readonly IHtmlLocalizer _localizer; - public HomeController(IHtmlLocalizer localizer, - ApplicationDbContext context) - { - _localizer = localizer; - _dbContext = context; - } - - public async Task Index(string id) - { - ViewBag.IsFromSecureProx = Request.Headers.ContainsKey(Constants.SshHeaderKey) && Request.Headers[Constants.SshHeaderKey] == "on"; - ViewBag.SecureHomeUrl = "https://" + Request.Headers["X-Forwarded-Host"]; - ViewBag.SshHeaderKey = Request.Headers[Constants.SshHeaderKey]; - var uid = User.GetUserId(); - long[] clicked = null; - if (uid == null) - { - await HttpContext.Session.LoadAsync(); - var strclicked = HttpContext.Session.GetString("clicked"); - if (strclicked != null) clicked = strclicked.Split(':').Select(c => long.Parse(c)).ToArray(); - if (clicked == null) clicked = new long[0]; - } - else clicked = _dbContext.DimissClicked.Where(d => d.UserId == uid).Select(d => d.NotificationId).ToArray(); - var notes = _dbContext.Notification.Where( - n => !clicked.Contains(n.Id) - ); - this.Notify(notes); - - ViewData["HaircutCommandCount"] = _dbContext.HairCutQueries.Where( - q => q.ClientId == uid && q.Status < QueryStatus.Failed - ).Count(); - var toShow = _dbContext.Activities - .Include(a => a.Forms) - .Include(a => a.Parent) - .Include(a => a.Children) - .Where(a => !a.Hidden) - .Where(a => a.ParentCode == id) - .OrderByDescending(a => a.Rate).ToList(); - - foreach (var a in toShow) - { - a.Children = a.Children.Where(c => !c.Hidden).ToList(); - } - return View(toShow); - } - public async Task About() - { - FileInfo fi = new FileInfo("wwwroot/version"); - return View("About", fi.Exists ? _localizer["Version logicielle: "] + await fi.OpenText().ReadToEndAsync() : _localizer["Aucune information sur la version logicielle n'est publiée."]); - } - public IActionResult Privacy() - { - return View(); - } - public IActionResult AboutMarkdown() - { - return View(); - } - - public IActionResult Contact() - { - return View(); - } - public IActionResult Dash() - { - return View(); - } - public ActionResult Chat() - { - if (User.Identity.IsAuthenticated) - { - ViewBag.IsAuthenticated = true; - string uid = User.GetUserId(); - ViewBag.Contacts = _dbContext.Contact.Where(c => c.OwnerId == uid) - ; - } - else ViewBag.IsAuthenticated = false; - return View(); - } - - public IActionResult Error() - { - var feature = this.HttpContext.Features.Get(); - - return View("~/Views/Shared/Error.cshtml", feature?.Error); - } - public IActionResult Status(int id) - { - ViewBag.StatusCode = id; - return View("~/Views/Shared/Status.cshtml"); - } - public IActionResult Todo() - { - User.GetUserId(); - - return View(); - } + _logger = logger; + } - public IActionResult VideoChat() - { - return View(); - } + public IActionResult Index() + { + return View(); + } - public IActionResult Audio() - { - return View(); - } + public IActionResult Privacy() + { + return View(); + } + [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] + public IActionResult Error() + { + return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier }); } } diff --git a/src/Yavsc/Controllers/HomeController.cs.old b/src/Yavsc/Controllers/HomeController.cs.old new file mode 100644 index 00000000..90dc0fb0 --- /dev/null +++ b/src/Yavsc/Controllers/HomeController.cs.old @@ -0,0 +1,135 @@ +using Microsoft.AspNet.Mvc.Localization; +using Microsoft.AspNet.Mvc; +using Microsoft.AspNet.Http.Features; +using Microsoft.AspNet.Diagnostics; +using Microsoft.AspNet.Authorization; +using Microsoft.AspNet.Hosting; +using Microsoft.AspNet.Identity; +using System.Linq; +using System.Security.Claims; +using Microsoft.Data.Entity; +using Microsoft.AspNet.Http; +using System.Threading.Tasks; + +namespace Yavsc.Controllers +{ + using System.IO; + using Models; + using Yavsc; + using Yavsc.Helpers; + + [AllowAnonymous] + public class HomeController : Controller + { + readonly ApplicationDbContext _dbContext; + + readonly IHtmlLocalizer _localizer; + public HomeController(IHtmlLocalizer localizer, + ApplicationDbContext context) + { + _localizer = localizer; + _dbContext = context; + } + + public async Task Index(string id) + { + ViewBag.IsFromSecureProx = Request.Headers.ContainsKey(Constants.SshHeaderKey) && Request.Headers[Constants.SshHeaderKey] == "on"; + ViewBag.SecureHomeUrl = "https://" + Request.Headers["X-Forwarded-Host"]; + ViewBag.SshHeaderKey = Request.Headers[Constants.SshHeaderKey]; + var uid = User.GetUserId(); + long[] clicked = null; + if (uid == null) + { + await HttpContext.Session.LoadAsync(); + var strclicked = HttpContext.Session.GetString("clicked"); + if (strclicked != null) clicked = strclicked.Split(':').Select(c => long.Parse(c)).ToArray(); + if (clicked == null) clicked = new long[0]; + } + else clicked = _dbContext.DimissClicked.Where(d => d.UserId == uid).Select(d => d.NotificationId).ToArray(); + var notes = _dbContext.Notification.Where( + n => !clicked.Contains(n.Id) + ); + this.Notify(notes); + + ViewData["HaircutCommandCount"] = _dbContext.HairCutQueries.Where( + q => q.ClientId == uid && q.Status < QueryStatus.Failed + ).Count(); + var toShow = _dbContext.Activities + .Include(a => a.Forms) + .Include(a => a.Parent) + .Include(a => a.Children) + .Where(a => !a.Hidden) + .Where(a => a.ParentCode == id) + .OrderByDescending(a => a.Rate).ToList(); + + foreach (var a in toShow) + { + a.Children = a.Children.Where(c => !c.Hidden).ToList(); + } + return View(toShow); + } + public async Task About() + { + FileInfo fi = new FileInfo("wwwroot/version"); + return View("About", fi.Exists ? _localizer["Version logicielle: "] + await fi.OpenText().ReadToEndAsync() : _localizer["Aucune information sur la version logicielle n'est publiée."]); + } + public IActionResult Privacy() + { + return View(); + } + public IActionResult AboutMarkdown() + { + return View(); + } + + public IActionResult Contact() + { + return View(); + } + public IActionResult Dash() + { + return View(); + } + public ActionResult Chat() + { + if (User.Identity.IsAuthenticated) + { + ViewBag.IsAuthenticated = true; + string uid = User.GetUserId(); + ViewBag.Contacts = _dbContext.Contact.Where(c => c.OwnerId == uid) + ; + } + else ViewBag.IsAuthenticated = false; + return View(); + } + + public IActionResult Error() + { + var feature = this.HttpContext.Features.Get(); + + return View("~/Views/Shared/Error.cshtml", feature?.Error); + } + public IActionResult Status(int id) + { + ViewBag.StatusCode = id; + return View("~/Views/Shared/Status.cshtml"); + } + public IActionResult Todo() + { + User.GetUserId(); + + return View(); + } + + public IActionResult VideoChat() + { + return View(); + } + + public IActionResult Audio() + { + return View(); + } + + } +} diff --git a/src/Yavsc/Controllers/IT/GitController.cs b/src/Yavsc/Controllers/IT/GitController.cs index 8ecbc815..8ad9631b 100644 --- a/src/Yavsc/Controllers/IT/GitController.cs +++ b/src/Yavsc/Controllers/IT/GitController.cs @@ -1,13 +1,10 @@ -using System.Linq; -using System.Security.Claims; -using System.Threading.Tasks; -using Microsoft.AspNet.Authorization; -using Microsoft.AspNet.Mvc; -using Microsoft.AspNet.Mvc.Rendering; -using Microsoft.Data.Entity; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.Rendering; using Yavsc.Models; using Yavsc.Server.Models.IT.SourceCode; using Yavsc.Helpers; +using Microsoft.EntityFrameworkCore; namespace Yavsc.Controllers { @@ -26,19 +23,19 @@ namespace Yavsc.Controllers { if (path == null) { - return HttpNotFound(); + return NotFound(); } /* GitRepositoryReference gitRepositoryReference = await _context.GitRepositoryReference.SingleAsync(m => m.Path == path); if (gitRepositoryReference == null) { - return HttpNotFound(); + return NotFound(); } */ var info = Startup.GitOptions.FileProvider.GetFileInfo(path); if (!info.Exists) - return HttpNotFound(); + return NotFound(); var stream = info.CreateReadStream(); if (path.EndsWith(".ansi.log")) { @@ -69,7 +66,7 @@ namespace Yavsc.Controllers GitRepositoryReference gitRepositoryReference = await _context.GitRepositoryReference.SingleAsync(m => m.Id == id); if (gitRepositoryReference == null) { - return HttpNotFound(); + return NotFound(); } return View(gitRepositoryReference); @@ -104,7 +101,7 @@ namespace Yavsc.Controllers GitRepositoryReference gitRepositoryReference = await _context.GitRepositoryReference.SingleAsync(m => m.Id == id); if (gitRepositoryReference == null) { - return HttpNotFound(); + return NotFound(); } ViewBag.OwnerId = new SelectList(_context.ApplicationUser, "Id", "Owner", gitRepositoryReference.OwnerId); return View(gitRepositoryReference); @@ -131,13 +128,13 @@ namespace Yavsc.Controllers { if (id == null) { - return HttpNotFound(); + return NotFound(); } GitRepositoryReference gitRepositoryReference = await _context.GitRepositoryReference.SingleAsync(m => m.Path == id); if (gitRepositoryReference == null) { - return HttpNotFound(); + return NotFound(); } return View(gitRepositoryReference); diff --git a/src/Yavsc/Controllers/IT/ProjectController.cs b/src/Yavsc/Controllers/IT/ProjectController.cs index ab627739..36105a68 100644 --- a/src/Yavsc/Controllers/IT/ProjectController.cs +++ b/src/Yavsc/Controllers/IT/ProjectController.cs @@ -1,16 +1,14 @@ -using System.Threading.Tasks; -using Microsoft.AspNet.Mvc; -using Microsoft.AspNet.Mvc.Rendering; -using Microsoft.Data.Entity; -using Microsoft.Extensions.Logging; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.Rendering; using Yavsc.Models; using Yavsc.Server.Models.IT; -using Microsoft.AspNet.Authorization; +using Microsoft.AspNetCore.Authorization; using Yavsc.Server.Helpers; using Yavsc.Models.Workflow; using Yavsc.Models.Payment; using Yavsc.Server.Models.IT.SourceCode; using Microsoft.Extensions.Localization; +using Microsoft.EntityFrameworkCore; namespace Yavsc.Controllers { @@ -43,13 +41,13 @@ namespace Yavsc.Controllers { if (id == null) { - return HttpNotFound(); + return NotFound(); } Project project = await _context.Project.SingleAsync(m => m.Id == id); if (project == null) { - return HttpNotFound(); + return NotFound(); } return View(project); @@ -103,13 +101,13 @@ namespace Yavsc.Controllers { if (id == null) { - return HttpNotFound(); + return NotFound(); } Project project = await _context.Project.SingleAsync(m => m.Id == id); if (project == null) { - return HttpNotFound(); + return NotFound(); } /* ViewBag.ClientId = new SelectList(_context.ApplicationUser, "Id", "Client", project.ClientId); ViewBag.ActivityCodeItems = new SelectList(_context.Activities, "Code", "Context", project.ActivityCode); @@ -142,13 +140,13 @@ namespace Yavsc.Controllers { if (id == null) { - return HttpNotFound(); + return NotFound(); } Project project = await _context.Project.SingleAsync(m => m.Id == id); if (project == null) { - return HttpNotFound(); + return NotFound(); } return View(project); diff --git a/src/Yavsc/Controllers/Musical/InstrumentRatingController.cs b/src/Yavsc/Controllers/Musical/InstrumentRatingController.cs index 57a98d3a..9030511f 100644 --- a/src/Yavsc/Controllers/Musical/InstrumentRatingController.cs +++ b/src/Yavsc/Controllers/Musical/InstrumentRatingController.cs @@ -1,10 +1,7 @@ -using System.Globalization; -using System.Linq; using System.Security.Claims; -using System.Threading.Tasks; -using Microsoft.AspNet.Mvc; -using Microsoft.AspNet.Mvc.Rendering; -using Microsoft.Data.Entity; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.Rendering; +using Microsoft.EntityFrameworkCore; using Yavsc.Models; using Yavsc.Models.Musical; @@ -22,7 +19,7 @@ namespace Yavsc.Controllers // GET: InstrumentRating public async Task Index() { - var uid = User.GetUserId(); + var uid = User.FindFirstValue(ClaimTypes.NameIdentifier); var applicationDbContext = _context.InstrumentRating .Include(i => i.Profile) @@ -37,15 +34,15 @@ namespace Yavsc.Controllers { if (id == null) { - return HttpNotFound(); + return NotFound(); } - var uid = User.GetUserId(); + var uid = User.FindFirstValue(ClaimTypes.NameIdentifier); InstrumentRating instrumentRating = await _context.InstrumentRating .Include(i => i.Instrument).SingleAsync(m => m.Id == id); if (instrumentRating == null) { - return HttpNotFound(); + return NotFound(); } return View(instrumentRating); @@ -54,7 +51,7 @@ namespace Yavsc.Controllers // GET: InstrumentRating/Create public async Task Create() { - var uid = User.GetUserId(); + var uid = User.FindFirstValue(ClaimTypes.NameIdentifier); var actual = await _context.InstrumentRating .Where(m => m.OwnerId == uid). Select( r => r.InstrumentId ).ToArrayAsync(); @@ -88,13 +85,13 @@ namespace Yavsc.Controllers { if (id == null) { - return HttpNotFound(); + return NotFound(); } InstrumentRating instrumentRating = await _context.InstrumentRating.SingleAsync(m => m.Id == id); if (instrumentRating == null) { - return HttpNotFound(); + return NotFound(); } ViewData["OwnerId"] = new SelectList(_context.Performers, "PerformerId", "Profile", instrumentRating.OwnerId); return View(instrumentRating); @@ -121,14 +118,14 @@ namespace Yavsc.Controllers { if (id == null) { - return HttpNotFound(); + return NotFound(); } InstrumentRating instrumentRating = await _context.InstrumentRating .Include(i => i.Instrument).SingleAsync(m => m.Id == id); if (instrumentRating == null) { - return HttpNotFound(); + return NotFound(); } return View(instrumentRating); diff --git a/src/Yavsc/Controllers/Musical/InstrumentationController.cs b/src/Yavsc/Controllers/Musical/InstrumentationController.cs index a9237f15..d84cf31c 100644 --- a/src/Yavsc/Controllers/Musical/InstrumentationController.cs +++ b/src/Yavsc/Controllers/Musical/InstrumentationController.cs @@ -1,10 +1,9 @@ -using System.Linq; using System.Security.Claims; -using System.Threading.Tasks; -using Microsoft.AspNet.Authorization; -using Microsoft.AspNet.Mvc; -using Microsoft.AspNet.Mvc.Rendering; -using Microsoft.Data.Entity; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.Rendering; +using Microsoft.EntityFrameworkCore; +using Yavsc.Helpers; using Yavsc.Models; using Yavsc.Models.Musical.Profiles; @@ -31,13 +30,13 @@ namespace Yavsc.Controllers { if (id == null) { - return HttpNotFound(); + return NotFound(); } Instrumentation musicianSettings = await _context.Instrumentation.SingleAsync(m => m.UserId == id); if (musicianSettings == null) { - return HttpNotFound(); + return NotFound(); } return View(musicianSettings); @@ -46,7 +45,7 @@ namespace Yavsc.Controllers // GET: Instrumentation/Create public IActionResult Create() { - var uid = User.GetUserId(); + var uid = User.FindFirstValue(ClaimTypes.NameIdentifier); var owned = _context.Instrumentation.Include(i=>i.Tool).Where(i=>i.UserId==uid).Select(i=>i.InstrumentId); var ownedArray = owned.ToArray(); @@ -61,7 +60,7 @@ namespace Yavsc.Controllers [ValidateAntiForgeryToken] public async Task Create(Instrumentation model) { - var uid = User.GetUserId(); + var uid = User.FindFirstValue(ClaimTypes.NameIdentifier); if (ModelState.IsValid) { if (model.UserId != uid) if (!User.IsInRole(Constants.AdminGroupName)) @@ -77,17 +76,17 @@ namespace Yavsc.Controllers // GET: Instrumentation/Edit/5 public async Task Edit(string id) { - var uid = User.GetUserId(); + var uid = User.FindFirstValue(ClaimTypes.NameIdentifier); if (id == null) { - return HttpNotFound(); + return NotFound(); } if (id != uid) if (!User.IsInRole(Constants.AdminGroupName)) return new ChallengeResult(); Instrumentation musicianSettings = await _context.Instrumentation.SingleAsync(m => m.UserId == id); if (musicianSettings == null) { - return HttpNotFound(); + return NotFound(); } return View(musicianSettings); } @@ -97,7 +96,7 @@ namespace Yavsc.Controllers [ValidateAntiForgeryToken] public async Task Edit(Instrumentation musicianSettings) { - var uid = User.GetUserId(); + var uid = User.FindFirstValue(ClaimTypes.NameIdentifier); if (musicianSettings.UserId != uid) if (!User.IsInRole(Constants.AdminGroupName)) return new ChallengeResult(); if (ModelState.IsValid) @@ -115,15 +114,15 @@ namespace Yavsc.Controllers { if (id == null) { - return HttpNotFound(); + return NotFound(); } Instrumentation musicianSettings = await _context.Instrumentation.SingleAsync(m => m.UserId == id); if (musicianSettings == null) { - return HttpNotFound(); + return NotFound(); } - var uid = User.GetUserId(); + var uid = User.FindFirstValue(ClaimTypes.NameIdentifier); if (musicianSettings.UserId != uid) if (!User.IsInRole(Constants.AdminGroupName)) return new ChallengeResult(); return View(musicianSettings); @@ -136,7 +135,7 @@ namespace Yavsc.Controllers { Instrumentation musicianSettings = await _context.Instrumentation.SingleAsync(m => m.UserId == id); - var uid = User.GetUserId(); + var uid = User.FindFirstValue(ClaimTypes.NameIdentifier); if (musicianSettings.UserId != uid) if (!User.IsInRole(Constants.AdminGroupName)) return new ChallengeResult(); diff --git a/src/Yavsc/Controllers/Musical/InstrumentsController.cs b/src/Yavsc/Controllers/Musical/InstrumentsController.cs index e4e79cd6..4f6e457c 100644 --- a/src/Yavsc/Controllers/Musical/InstrumentsController.cs +++ b/src/Yavsc/Controllers/Musical/InstrumentsController.cs @@ -1,11 +1,13 @@ using System.Linq; -using Microsoft.AspNet.Mvc; +using Microsoft.AspNetCore.Mvc; namespace Yavsc.Controllers { using System.Security.Claims; using Models; using Models.Musical; + using Yavsc.Helpers; + public class InstrumentsController : Controller { private readonly ApplicationDbContext _context; @@ -26,13 +28,13 @@ namespace Yavsc.Controllers { if (id == null) { - return HttpNotFound(); + return NotFound(); } Instrument instrument = _context.Instrument.Single(m => m.Id == id); if (instrument == null) { - return HttpNotFound(); + return NotFound(); } return View(instrument); @@ -63,13 +65,13 @@ namespace Yavsc.Controllers { if (id == null) { - return HttpNotFound(); + return NotFound(); } Instrument instrument = _context.Instrument.Single(m => m.Id == id); if (instrument == null) { - return HttpNotFound(); + return NotFound(); } return View(instrument); } @@ -94,13 +96,13 @@ namespace Yavsc.Controllers { if (id == null) { - return HttpNotFound(); + return NotFound(); } Instrument instrument = _context.Instrument.Single(m => m.Id == id); if (instrument == null) { - return HttpNotFound(); + return NotFound(); } return View(instrument); diff --git a/src/Yavsc/Controllers/Survey/BugController.cs b/src/Yavsc/Controllers/Survey/BugController.cs index 10525a52..ef252a23 100644 --- a/src/Yavsc/Controllers/Survey/BugController.cs +++ b/src/Yavsc/Controllers/Survey/BugController.cs @@ -1,15 +1,12 @@ -using System.Threading.Tasks; -using Microsoft.AspNet.Mvc; -using Microsoft.Data.Entity; +using Microsoft.AspNetCore.Mvc; using Yavsc.Models; using Yavsc.Models.IT.Fixing; using Yavsc.Models.IT.Evolution; using Yavsc.Server.Helpers; -using System.Collections.Generic; -using Microsoft.AspNet.Mvc.Rendering; +using Microsoft.AspNetCore.Mvc.Rendering; using Microsoft.Extensions.Localization; -using Microsoft.AspNet.Authorization; -using System.Linq; +using Microsoft.AspNetCore.Authorization; +using Microsoft.EntityFrameworkCore; namespace Yavsc.Controllers { @@ -40,13 +37,13 @@ namespace Yavsc.Controllers { if (id == null) { - return HttpNotFound(); + return NotFound(); } Bug bug = await _context.Bug.SingleAsync(m => m.Id == id); if (bug == null) { - return HttpNotFound(); + return NotFound(); } return View(bug); @@ -89,13 +86,13 @@ namespace Yavsc.Controllers { if (id == null) { - return HttpNotFound(); + return NotFound(); } Bug bug = await _context.Bug.SingleAsync(m => m.Id == id); if (bug == null) { - return HttpNotFound(); + return NotFound(); } ViewBag.Features = Features(_context); @@ -126,13 +123,13 @@ namespace Yavsc.Controllers { if (id == null) { - return HttpNotFound(); + return NotFound(); } Bug bug = await _context.Bug.SingleAsync(m => m.Id == id); if (bug == null) { - return HttpNotFound(); + return NotFound(); } return View(bug); @@ -156,7 +153,7 @@ namespace Yavsc.Controllers { if (id == null) { - return HttpNotFound(); + return NotFound(); } Bug bugref = await _context.Bug.SingleAsync(m => m.Id == id); if (bugref == null) diff --git a/src/Yavsc/Controllers/Survey/FeatureController.cs b/src/Yavsc/Controllers/Survey/FeatureController.cs index 1c385161..24c20dc6 100644 --- a/src/Yavsc/Controllers/Survey/FeatureController.cs +++ b/src/Yavsc/Controllers/Survey/FeatureController.cs @@ -1,12 +1,9 @@ - -using System.Collections.Generic; -using System.Threading.Tasks; -using Microsoft.AspNet.Mvc; -using Microsoft.AspNet.Mvc.Rendering; -using Microsoft.Data.Entity; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.Rendering; namespace Yavsc.Controllers { + using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Localization; using Models; using Models.IT.Evolution; @@ -36,13 +33,13 @@ namespace Yavsc.Controllers { if (id == null) { - return HttpNotFound(); + return NotFound(); } Feature feature = await _context.Feature.SingleAsync(m => m.Id == id); if (feature == null) { - return HttpNotFound(); + return NotFound(); } return View(feature); @@ -75,13 +72,13 @@ namespace Yavsc.Controllers { if (id == null) { - return HttpNotFound(); + return NotFound(); } Feature feature = await _context.Feature.SingleAsync(m => m.Id == id); if (feature == null) { - return HttpNotFound(); + return NotFound(); } var featureStatusEnumType = typeof(FeatureStatus); var fsstatuses = new List(); @@ -113,13 +110,13 @@ namespace Yavsc.Controllers { if (id == null) { - return HttpNotFound(); + return NotFound(); } Feature feature = await _context.Feature.SingleAsync(m => m.Id == id); if (feature == null) { - return HttpNotFound(); + return NotFound(); } return View(feature); diff --git a/src/Yavsc/Controllers/Survey/TestController.cs b/src/Yavsc/Controllers/Survey/TestController.cs index bc737fc5..b2d56d4e 100644 --- a/src/Yavsc/Controllers/Survey/TestController.cs +++ b/src/Yavsc/Controllers/Survey/TestController.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNet.Mvc; +using Microsoft.AspNetCore.Mvc; namespace Yavsc.Controllers { @@ -13,4 +13,4 @@ namespace Yavsc.Controllers return View(); } } -} \ No newline at end of file +} diff --git a/src/Yavsc/CustomModelBinder.cs b/src/Yavsc/CustomModelBinder.cs index 22262d94..c12084c5 100644 --- a/src/Yavsc/CustomModelBinder.cs +++ b/src/Yavsc/CustomModelBinder.cs @@ -1,44 +1,43 @@ using System; using System.Globalization; using System.Threading.Tasks; -using Microsoft.AspNet.Mvc.ModelBinding; +using Microsoft.AspNetCore.Mvc.ModelBinding; namespace Yavsc { public class MyDecimalModelBinder : IModelBinder { - public async Task BindModelAsync(ModelBindingContext bindingContext) + async Task IModelBinder.BindModelAsync(ModelBindingContext bindingContext) { - ValueProviderResult valueResult = bindingContext.ValueProvider + ValueProviderResult valueResult = bindingContext.ValueProvider .GetValue(bindingContext.ModelName); decimal actualValue ; try { - actualValue = Decimal.Parse(valueResult.FirstValue, System.Globalization.NumberStyles.AllowDecimalPoint); - return await ModelBindingResult.SuccessAsync(bindingContext.ModelName,actualValue); + bindingContext.Result = ModelBindingResult.Success( + Decimal.Parse(valueResult.FirstValue, System.Globalization.NumberStyles.AllowDecimalPoint)); } catch (Exception ) { + bindingContext.Result = ModelBindingResult.Failed(); } - return await ModelBindingResult.FailedAsync(bindingContext.ModelName); } } public class MyDateTimeModelBinder : IModelBinder { - public async Task BindModelAsync(ModelBindingContext bindingContext) + async Task IModelBinder.BindModelAsync(ModelBindingContext bindingContext) { ValueProviderResult valueResult = bindingContext.ValueProvider .GetValue(bindingContext.ModelName); DateTime actualValue ; - ModelStateEntry modelState = new ModelStateEntry(); - // DateTime are sent in the french format - if (DateTime.TryParse(valueResult.FirstValue,new CultureInfo("fr-FR"), DateTimeStyles.AllowInnerWhite, out actualValue)) - { - return await ModelBindingResult.SuccessAsync(bindingContext.ModelName,actualValue); - } - - return await ModelBindingResult.FailedAsync(bindingContext.ModelName); + // DateTime are sent in the french format + if (DateTime.TryParse(valueResult.FirstValue,new CultureInfo("fr-FR"), DateTimeStyles.AllowInnerWhite, out actualValue)) + { + bindingContext.Result = ModelBindingResult.Success(actualValue); + } + else bindingContext.Result = ModelBindingResult.Failed(); + } } } diff --git a/src/Yavsc/Extensions/AppBuilderExtensions.cs b/src/Yavsc/Extensions/AppBuilderExtensions.cs index 8feabcf3..d04e1be7 100644 --- a/src/Yavsc/Extensions/AppBuilderExtensions.cs +++ b/src/Yavsc/Extensions/AppBuilderExtensions.cs @@ -1,6 +1,6 @@ using System; -using Microsoft.AspNet.Builder; -using Microsoft.AspNet.Http; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Http; namespace Yavsc.Extensions { public static class AppBuilderExtensions { @@ -36,4 +36,4 @@ namespace Yavsc.Extensions { }); } } -} \ No newline at end of file +} diff --git a/src/Yavsc/Extensions/EnumExtensions.cs b/src/Yavsc/Extensions/EnumExtensions.cs index 16179358..ae733f20 100644 --- a/src/Yavsc/Extensions/EnumExtensions.cs +++ b/src/Yavsc/Extensions/EnumExtensions.cs @@ -4,7 +4,7 @@ using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Reflection; -using Microsoft.AspNet.Mvc.Rendering; +using Microsoft.AspNetCore.Mvc.Rendering; using Microsoft.Extensions.Localization; namespace Yavsc.Extensions diff --git a/src/Yavsc/Extensions/OAuthAuthorizationServerExtensions.cs b/src/Yavsc/Extensions/OAuthAuthorizationServerExtensions.cs deleted file mode 100644 index 12112e9b..00000000 --- a/src/Yavsc/Extensions/OAuthAuthorizationServerExtensions.cs +++ /dev/null @@ -1,59 +0,0 @@ -using System; -using OAuth.AspNet.AuthServer; - -namespace Microsoft.AspNet.Builder -{ - - /// - /// Extension methods to add Authorization Server capabilities to an OWIN pipeline - /// - public static class OAuthAuthorizationServerExtensions - { - /// - /// Adds OAuth2 Authorization Server capabilities to an OWIN web application. This middleware - /// performs the request processing for the Authorize and Token endpoints defined by the OAuth2 specification. - /// See also http://tools.ietf.org/html/rfc6749 - /// - /// The web application builder - /// Options which control the behavior of the Authorization Server. - /// The application builder - public static IApplicationBuilder UseOAuthAuthorizationServer(this IApplicationBuilder app, OAuthAuthorizationServerOptions options) - { - if (app == null) - throw new NullReferenceException($"The extension method {nameof(OAuthAuthorizationServerExtensions.UseOAuthAuthorizationServer)} was called on a null reference to a {nameof(IApplicationBuilder)}"); - - if (options == null) - throw new ArgumentNullException(nameof(options)); - - - - return app.UseMiddleware(options); - } - - - /// - /// Adds OAuth2 Authorization Server capabilities to an OWIN web application. This middleware - /// performs the request processing for the Authorize and Token endpoints defined by the OAuth2 specification. - /// See also http://tools.ietf.org/html/rfc6749 - /// - /// The web application builder - /// Options which control the behavior of the Authorization Server. - /// The application builder - public static IApplicationBuilder UseOAuthAuthorizationServer(this IApplicationBuilder app, Action configureOptions) - { - if (app == null) - throw new NullReferenceException($"The extension method {nameof(OAuthAuthorizationServerExtensions.UseOAuthAuthorizationServer)} was called on a null reference to a {nameof(IApplicationBuilder)}"); - - if (configureOptions == null) - throw new ArgumentNullException(nameof(configureOptions)); - - - var options = new OAuthAuthorizationServerOptions(); - - configureOptions?.Invoke(options); - - return app.UseOAuthAuthorizationServer(options); - } - } - -} diff --git a/src/Yavsc/Extensions/SignalRBuilderExtension.cs b/src/Yavsc/Extensions/SignalRBuilderExtension.cs deleted file mode 100644 index 00e8151d..00000000 --- a/src/Yavsc/Extensions/SignalRBuilderExtension.cs +++ /dev/null @@ -1,47 +0,0 @@ -using Microsoft.AspNet.Builder; -using Microsoft.Owin.Builder; -using Owin; -using System; -using System.Collections.Generic; -using System.Threading.Tasks; - -namespace Yavsc -{ - using Microsoft.AspNet.SignalR; - using AppFunc = Func, Task>; - - public static class BuilderExtensions - { - public static IApplicationBuilder UseAppBuilder( - this IApplicationBuilder app, - Action configure) - { - app.UseOwin(addToPipeline => - { - addToPipeline(next => - { - var appBuilder = new AppBuilder(); - appBuilder.Properties["builder.DefaultApp"] = next; - - configure(appBuilder); - - return appBuilder.Build(); - }); - }); - - return app; - } - - public static void UseSignalR(this IApplicationBuilder app, string path = "/signalr") - { - app.UseAppBuilder(appBuilder => appBuilder.MapSignalR( - path, - new HubConfiguration() { - EnableDetailedErrors = true, - EnableJSONP = true, - EnableJavaScriptProxies = true - } - )); - } - } -} diff --git a/src/Yavsc/Formatters/PdfFormatter.cs b/src/Yavsc/Formatters/PdfFormatter.cs deleted file mode 100644 index aed1fff2..00000000 --- a/src/Yavsc/Formatters/PdfFormatter.cs +++ /dev/null @@ -1,38 +0,0 @@ - -using System; -using System.IO; -using System.Threading.Tasks; -using Microsoft.AspNet.Mvc.Formatters; -using Microsoft.Extensions.WebEncoders; - - -namespace Yavsc.Formatters { - public class PdfFormatter : OutputFormatter - { - public override Task WriteResponseBodyAsync(OutputFormatterWriteContext context) - { - -throw new NotImplementedException(); - - } - } - - public class TexEncoder : IHtmlEncoder - { - public string HtmlEncode(string value) - { - return value; - } - - public void HtmlEncode(string value, int startIndex, int charCount, TextWriter output) - { - output.Write(value.Substring(startIndex,charCount)); - } - - public void HtmlEncode(char[] value, int startIndex, int charCount, TextWriter output) - { - output.Write(value,startIndex,charCount); - } - } - -} \ No newline at end of file diff --git a/src/Yavsc/Helpers/AuthHelpers.cs b/src/Yavsc/Helpers/AuthHelpers.cs index 02ba797c..826d2714 100644 --- a/src/Yavsc/Helpers/AuthHelpers.cs +++ b/src/Yavsc/Helpers/AuthHelpers.cs @@ -1,7 +1,7 @@ using System; using System.Linq; using System.Collections.Generic; -using Microsoft.AspNet.Http; +using Microsoft.AspNetCore.Http; using Yavsc.ViewModels.Account; namespace Yavsc.Helpers @@ -12,7 +12,7 @@ namespace Yavsc.Helpers throw new ArgumentNullException(nameof(context)); } - return from description in context.Authentication.GetAuthenticationSchemes() + return from description in context.GetExternalProviders() where !string.IsNullOrEmpty(description.DisplayName) select ( new YaAuthenticationDescription @@ -35,4 +35,4 @@ namespace Yavsc.Helpers } -} \ No newline at end of file +} diff --git a/src/Yavsc/Helpers/ControllerHelpers.cs b/src/Yavsc/Helpers/ControllerHelpers.cs index b034a295..e071723d 100644 --- a/src/Yavsc/Helpers/ControllerHelpers.cs +++ b/src/Yavsc/Helpers/ControllerHelpers.cs @@ -1,5 +1,5 @@ using System.Collections.Generic; -using Microsoft.AspNet.Mvc; +using Microsoft.AspNetCore.Mvc; using Yavsc.Models.Messaging; namespace Yavsc.Helpers @@ -52,7 +52,7 @@ namespace Yavsc.Helpers if (accepted == "application/json") { if (controller.ModelState.ErrorCount>0) - result = controller.HttpBadRequest(controller.ModelState); + result = controller.BadRequest(controller.ModelState); else result = controller.Ok(model); return true; @@ -69,4 +69,4 @@ namespace Yavsc.Helpers else return controller.View(viewname, model); } } -} \ No newline at end of file +} diff --git a/src/Yavsc/Helpers/ExternalAuthStoreHelper.cs b/src/Yavsc/Helpers/ExternalAuthStoreHelper.cs index 04d8cfbc..1a402fd8 100644 --- a/src/Yavsc/Helpers/ExternalAuthStoreHelper.cs +++ b/src/Yavsc/Helpers/ExternalAuthStoreHelper.cs @@ -1,11 +1,9 @@ -using System; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.Data.Entity; + using Newtonsoft.Json.Linq; namespace Yavsc.Helpers.Auth { + using Microsoft.EntityFrameworkCore; using Yavsc.Models; using Yavsc.Models.Auth; public static class ExternalAuthStoreHelper { diff --git a/src/Yavsc/Helpers/FileSystemHelpers.cs b/src/Yavsc/Helpers/FileSystemHelpers.cs index 5348b969..8f103521 100644 --- a/src/Yavsc/Helpers/FileSystemHelpers.cs +++ b/src/Yavsc/Helpers/FileSystemHelpers.cs @@ -1,14 +1,9 @@ - -using System; using System.Drawing; using System.Drawing.Imaging; -using System.IO; using System.Security.Claims; -using System.Threading; -using System.Web; -using Microsoft.AspNet.FileProviders; -using Microsoft.AspNet.Http; +using Microsoft.AspNetCore.Html; +using Microsoft.Extensions.FileProviders; using Yavsc.Exceptions; using Yavsc.Models; using Yavsc.Models.FileSystem; @@ -314,5 +309,10 @@ namespace Yavsc.Helpers var basename = flow.DifferedFileName.Substring(0,namelen); return $"{basename}-{flow.SequenceNumber}{ext}"; } + + public static void SaveAs(this IFormFile file, string destFileName) + { + throw new NotImplementedException(); + } } } diff --git a/src/Yavsc/Helpers/GoogleOAuthHelpers.cs b/src/Yavsc/Helpers/GoogleOAuthHelpers.cs index e758a213..a468aba1 100644 --- a/src/Yavsc/Helpers/GoogleOAuthHelpers.cs +++ b/src/Yavsc/Helpers/GoogleOAuthHelpers.cs @@ -23,8 +23,6 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; -using Microsoft.Data.Entity; -using Microsoft.AspNet.Identity.EntityFramework; using Google.Apis.Auth.OAuth2; using Google.Apis.Services; @@ -37,6 +35,9 @@ using Yavsc.Models; using Yavsc.Models.Calendar; using Yavsc.Services; using Yavsc.Server.Helpers; +using Microsoft.AspNetCore.Identity; +using Microsoft.EntityFrameworkCore; +using Yavsc.Server.Models.Calendar; namespace Yavsc.Helpers { diff --git a/src/Yavsc/Helpers/HtmlHelpers.cs b/src/Yavsc/Helpers/HtmlHelpers.cs index c471a2f6..81490d6e 100644 --- a/src/Yavsc/Helpers/HtmlHelpers.cs +++ b/src/Yavsc/Helpers/HtmlHelpers.cs @@ -1,6 +1,7 @@ using System; -using Microsoft.AspNet.Http; -using Microsoft.AspNet.Mvc.Rendering; +using Microsoft.AspNetCore.Html; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc.Rendering; using Yavsc.Models.Drawing; namespace Yavsc.Helpers diff --git a/src/Yavsc/Helpers/ListItemHelpers.cs b/src/Yavsc/Helpers/ListItemHelpers.cs index 18a62eba..e7fb98a0 100644 --- a/src/Yavsc/Helpers/ListItemHelpers.cs +++ b/src/Yavsc/Helpers/ListItemHelpers.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using System.Linq; -using Microsoft.AspNet.Mvc.Rendering; +using Microsoft.AspNetCore.Mvc.Rendering; using Yavsc.Models; using Yavsc.Models.Workflow; @@ -19,4 +19,4 @@ namespace Yavsc.Helpers { return items; } } -} \ No newline at end of file +} diff --git a/src/Yavsc/Helpers/PageHelpers.cs b/src/Yavsc/Helpers/PageHelpers.cs index 70e5ee8d..670a9ad0 100644 --- a/src/Yavsc/Helpers/PageHelpers.cs +++ b/src/Yavsc/Helpers/PageHelpers.cs @@ -1,6 +1,6 @@ using System; using System.Collections.Generic; -using Microsoft.AspNet.Mvc.Rendering; +using Microsoft.AspNetCore.Mvc.Rendering; using Microsoft.Extensions.Localization; namespace Yavsc.Server.Helpers diff --git a/src/Yavsc/Helpers/PayPalHelpers.cs b/src/Yavsc/Helpers/PayPalHelpers.cs index 0fae4fe2..45e310ab 100644 --- a/src/Yavsc/Helpers/PayPalHelpers.cs +++ b/src/Yavsc/Helpers/PayPalHelpers.cs @@ -2,16 +2,16 @@ using System.Collections.Generic; using Microsoft.Extensions.Logging; using Yavsc.Models.Billing; -using Microsoft.AspNet.Http; +using Microsoft.AspNetCore.Http; using System.Threading.Tasks; using Newtonsoft.Json; using PayPal.PayPalAPIInterfaceService.Model; using PayPal.PayPalAPIInterfaceService; using Yavsc.ViewModels.PayPal; using Yavsc.Models; -using Microsoft.Data.Entity; using System.Linq; using Yavsc.Models.Payment; +using Microsoft.EntityFrameworkCore; namespace Yavsc.Helpers { diff --git a/src/Yavsc/Helpers/RequestHelpers.cs b/src/Yavsc/Helpers/RequestHelpers.cs index 841418d5..96f060c3 100644 --- a/src/Yavsc/Helpers/RequestHelpers.cs +++ b/src/Yavsc/Helpers/RequestHelpers.cs @@ -1,12 +1,11 @@ using System.Collections.Generic; using Microsoft.Extensions.Logging; -using Microsoft.AspNet.Http; +using Microsoft.AspNetCore.Http; using System.Threading.Tasks; using Newtonsoft.Json; using Yavsc.ViewModels; using Yavsc.Models; -using Microsoft.Data.Entity; using System.Linq; namespace Yavsc.Helpers @@ -26,4 +25,4 @@ namespace Yavsc.Helpers return host; } } -} \ No newline at end of file +} diff --git a/src/Yavsc/Helpers/Tags/MarkDownTagHelper.cs b/src/Yavsc/Helpers/Tags/MarkDownTagHelper.cs deleted file mode 100644 index b1cc967f..00000000 --- a/src/Yavsc/Helpers/Tags/MarkDownTagHelper.cs +++ /dev/null @@ -1,153 +0,0 @@ - - -using System.Text.RegularExpressions; -using System.Threading.Tasks; -using MarkdownDeep; -using Microsoft.AspNet.Mvc.Rendering; -using Microsoft.AspNet.Razor.TagHelpers; - -namespace Yavsc.TagHelpers -{ - - [HtmlTargetElement("div", Attributes = MarkdownContentAttributeName)] - [HtmlTargetElement("h1", Attributes = MarkdownContentAttributeName)] - [HtmlTargetElement("h2", Attributes = MarkdownContentAttributeName)] - [HtmlTargetElement("h3", Attributes = MarkdownContentAttributeName)] - [HtmlTargetElement("p", Attributes = "ismarkdown")] - [HtmlTargetElement("div", Attributes = "ismarkdown")] - [HtmlTargetElement("h1", Attributes = "ismarkdown")] - [HtmlTargetElement("h2", Attributes = "ismarkdown")] - [HtmlTargetElement("h3", Attributes = "ismarkdown")] - [HtmlTargetElement("markdown")] - [OutputElementHint("p")] - public class MarkdownTagHelper : TagHelper - { - private const string MarkdownContentAttributeName = "markdown"; - private const string MarkdownMarkAttributeName = "ismarkdown"; - private const string SummaryMarkAttributeName = "summary"; - [HtmlAttributeName("site")] - public SiteSettings Site { get; set; } - [HtmlAttributeName("base")] - public string Base { get; set; } - - [HtmlAttributeName(MarkdownContentAttributeName)] - public string MarkdownContent { get; set; } - - - [HtmlAttributeName(SummaryMarkAttributeName)] - public int Summary { get; set; } - - - static Regex rxExtractLanguage = new Regex("^({{(.+)}}[\r\n])", RegexOptions.Compiled); - private static string FormatCodePrettyPrint(MarkdownDeep.Markdown m, string code) - { - // Try to extract the language from the first line - var match = rxExtractLanguage.Match(code); - string language = null; - - if (match.Success) - { - // Save the language - var g = (Group)match.Groups[2]; - language = g.ToString(); - - // Remove the first line - code = code.Substring(match.Groups[1].Length); - } - - // If not specified, look for a link definition called "default_syntax" and - // grab the language from its title - if (language == null) - { - var d = m.GetLinkDefinition("default_syntax"); - if (d != null) - language = d.title; - } - - // Common replacements - if (language == "C#") - language = "csharp"; - if (language == "C++") - language = "cpp"; - - // Wrap code in pre/code tags and add PrettyPrint attributes if necessary - if (string.IsNullOrEmpty(language)) - return string.Format("
{0}
\n", code); - else - return string.Format("
{1}
\n", - language.ToLowerInvariant(), code); - } - - - /// - /// Transforms a string of Markdown into HTML. - /// - /// The Markdown that should be transformed. - /// The url Base Location. - /// The HTML representation of the supplied Markdown. - public string Markdown(string text, string urlBaseLocation = "") - { - // Transform the supplied text (Markdown) into HTML. - var markdownTransformer = GetMarkdownTransformer(); - markdownTransformer.UrlBaseLocation = urlBaseLocation; - // Si seul un sommaire est demandé, - // s'assurer que la longueur du contenu ne dépasse pas de trop la longueur indiquée - if (Summary > 0) - { - if (text.Length > Summary + 28) - { - text = text.Substring(0, Summary + 28); - } - } - - string html = markdownTransformer.Transform(text); - - // Wrap the html in an MvcHtmlString otherwise it'll be HtmlEncoded and displayed to the user as HTML :( - return html; - } - - internal Markdown GetMarkdownTransformer() - { - var markdownTransformer = new Markdown(); - markdownTransformer.ExtraMode = true; - markdownTransformer.NoFollowLinks = true; - markdownTransformer.SafeMode = false; - markdownTransformer.FormatCodeBlock = FormatCodePrettyPrint; - markdownTransformer.ExtractHeadBlocks = true; - markdownTransformer.UserBreaks = true; - markdownTransformer.SummaryLength = Summary; - // TODO markdownTransformer.DoOnlyHtmlChunk = true; - return markdownTransformer; - } - - public ModelExpression Content { get; set; } - - public async override Task ProcessAsync(TagHelperContext context, TagHelperOutput output) - { - if (output.TagName == "markdown") - { - output.TagName = null; - } - output.Attributes.RemoveAll("markdown"); - - var content = await GetContent(output); - var markdown = content; - - var htbase = Base; - - - var html = Markdown(markdown, htbase); - - output.Content.SetHtmlContent(html ?? ""); - } - private async Task GetContent(TagHelperOutput output) - { - if (MarkdownContent != null) - return MarkdownContent; - if (Content != null) - return Content.Model?.ToString(); - return (await output.GetChildContentAsync(false)).GetContent(); - } - } - -} diff --git a/src/Yavsc/Helpers/TeXHelpers.cs b/src/Yavsc/Helpers/TeXHelpers.cs index 1d0f933f..6ed7ff17 100644 --- a/src/Yavsc/Helpers/TeXHelpers.cs +++ b/src/Yavsc/Helpers/TeXHelpers.cs @@ -2,13 +2,14 @@ using System; using System.Diagnostics; using System.IO; using System.Linq; -using Microsoft.AspNet.Http; -using Microsoft.AspNet.Mvc; -using Microsoft.AspNet.Mvc.Rendering; -using Microsoft.AspNet.Mvc.ViewEngines; +using Microsoft.AspNetCore.Html; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.Rendering; +using Microsoft.AspNetCore.Mvc.ViewEngines; namespace Yavsc.Helpers { + using Microsoft.AspNetCore.Mvc.Infrastructure; using ViewModels.Gen; public class TeXString : HtmlString { @@ -172,8 +173,8 @@ namespace Yavsc.Helpers public static string RenderViewToString( this Controller controller, IViewEngine engine, - IHttpContextAccessor httpContextAccessor, - string viewName, object model) + IActionContextAccessor contextAccessor, + string viewName, object model, bool isMainPage = true) { using (var sw = new StringWriter()) { @@ -182,19 +183,17 @@ namespace Yavsc.Helpers // try to find the specified view controller.TryValidateModel(model); - ViewEngineResult viewResult = engine.FindPartialView(controller.ActionContext, viewName); + ViewEngineResult viewResult = engine.FindView(contextAccessor.ActionContext, viewName, isMainPage); // create the associated context ViewContext viewContext = new ViewContext(); - viewContext.ActionDescriptor = controller.ActionContext.ActionDescriptor; - viewContext.HttpContext = controller.ActionContext.HttpContext; + viewContext.ActionDescriptor = contextAccessor.ActionContext.ActionDescriptor; + viewContext.HttpContext = contextAccessor.ActionContext.HttpContext; viewContext.TempData = controller.TempData; viewContext.View = viewResult.View; viewContext.Writer = sw; - // write the render view with the given context to the stringwriter - viewResult.View.RenderAsync(viewContext); - viewResult.EnsureSuccessful(); + viewResult.View.RenderAsync(viewContext).Wait(); return sw.GetStringBuilder().ToString(); } } diff --git a/src/Yavsc/Helpers/UserHelpers.cs b/src/Yavsc/Helpers/UserHelpers.cs index 093eab20..bb1df0d2 100644 --- a/src/Yavsc/Helpers/UserHelpers.cs +++ b/src/Yavsc/Helpers/UserHelpers.cs @@ -1,6 +1,7 @@ +using System.Security.Claims; using System.Collections.Generic; using System.Linq; -using Microsoft.Data.Entity; +using Microsoft.EntityFrameworkCore; using Yavsc.Models; using Yavsc.Models.Blog; @@ -9,6 +10,21 @@ namespace Yavsc.Helpers public static class UserHelpers { + public static string GetUserId(this ClaimsPrincipal user) + { + return user.FindFirstValue(ClaimTypes.NameIdentifier); + } + + public static string GetUserName(this ClaimsPrincipal user) + { + return user.FindFirstValue(ClaimTypes.Name); + } + + public static bool IsSignedIn(this ClaimsPrincipal user) + { + return user.Identity.IsAuthenticated; + } + public static IEnumerable UserPosts(this ApplicationDbContext dbContext, string posterId, string readerId) { long[] readerCirclesMemberships = dbContext.Circle.Include(c=>c.Members).Where(c=>c.Members.Any(m=>m.MemberId == readerId)) diff --git a/src/Yavsc/Helpers/WorkflowHelpers.cs b/src/Yavsc/Helpers/WorkflowHelpers.cs index fe29aec3..d4653a5d 100644 --- a/src/Yavsc/Helpers/WorkflowHelpers.cs +++ b/src/Yavsc/Helpers/WorkflowHelpers.cs @@ -4,7 +4,7 @@ namespace Yavsc.Helpers { using System.Collections.Generic; using System.Linq; - using Microsoft.Data.Entity; + using Microsoft.EntityFrameworkCore; using Yavsc.Models; using Yavsc.Services; using Yavsc.ViewModels.FrontOffice; diff --git a/src/Yavsc/Hubs/ChatHub.cs b/src/Yavsc/Hubs/ChatHub.cs index 717410b2..be1444ab 100644 --- a/src/Yavsc/Hubs/ChatHub.cs +++ b/src/Yavsc/Hubs/ChatHub.cs @@ -20,8 +20,7 @@ // along with this program. If not, see . using System; -using Microsoft.AspNet.SignalR; -using Microsoft.Data.Entity; +using Microsoft.AspNetCore.SignalR; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using System.Linq; @@ -30,7 +29,8 @@ using Microsoft.Extensions.Localization; namespace Yavsc { - + using Microsoft.AspNetCore.Authorization; + using Microsoft.EntityFrameworkCore; using Models; using Models.Chat; using Yavsc.Abstract.Chat; @@ -60,7 +60,7 @@ namespace Yavsc NotifyUser(NotificationTypes.Error, context, error); }); _logger = loggerFactory.CreateLogger(); - InputValidator = new HubInputValidator { NotifyUser = this.NotifyUser }; + InputValidator = new HubInputValidator { NotifyUser = async (type, target, msg) => await this.NotifyUser(type, target, msg) }; } void SetUserName(string cxId, string userName) @@ -68,7 +68,7 @@ namespace Yavsc _cxManager.SetUserName(cxId, userName); } - public override async Task OnConnected() + public override async Task OnConnectedAsync() { bool isAuth = (Context.User != null); bool isCop = false; @@ -79,32 +79,32 @@ namespace Yavsc var group = isAuth ? ChatHubConstants.HubGroupAuthenticated : ChatHubConstants.HubGroupAnonymous; // Log ("Cx: " + group); - await Groups.Add(Context.ConnectionId, group); + await Groups.AddToGroupAsync(Context.ConnectionId, group); _logger.LogInformation(_localizer.GetString(ChatHubConstants.LabAuthChatUser)); var userId = _dbContext.Users.First(u => u.UserName == userName).Id; - Clients.Group(ChatHubConstants.HubGroupFollowingPrefix + userId).notifyUser(NotificationTypes.Connected, userName, null); + await Clients.Group(ChatHubConstants.HubGroupFollowingPrefix + userId).SendAsync("notifyUser", NotificationTypes.Connected, userName, null); isCop = Context.User.IsInRole(Constants.AdminGroupName) ; if (isCop) { - await Groups.Add(Context.ConnectionId, ChatHubConstants.HubGroupCops); + await Groups.AddToGroupAsync(Context.ConnectionId, ChatHubConstants.HubGroupCops); } foreach (var uid in _dbContext.CircleMembers.Select(m => m.MemberId)) { - await Groups.Add(Context.ConnectionId, ChatHubConstants.HubGroupFollowingPrefix + uid); + await Groups.AddToGroupAsync(Context.ConnectionId, ChatHubConstants.HubGroupFollowingPrefix + uid); } } else { - await Groups.Add(Context.ConnectionId, ChatHubConstants.HubGroupAnonymous); + await Groups.AddToGroupAsync(Context.ConnectionId, ChatHubConstants.HubGroupAnonymous); } _cxManager.OnConnected(Context.ConnectionId, isCop); - await base.OnConnected(); + await base.OnConnectedAsync(); } - string setUserName() + string setUserName(string queryUname = "anon") { if (Context.User != null) if (Context.User.Identity.IsAuthenticated) @@ -114,7 +114,6 @@ namespace Yavsc } anonymousSequence++; - var queryUname = Context.Request.QueryString[ChatHubConstants.KeyParamChatUserName]; var aname = $"{ChatHubConstants.AnonymousUserNamePrefix}{queryUname}{anonymousSequence}"; SetUserName(Context.ConnectionId, aname); @@ -123,41 +122,29 @@ namespace Yavsc static long anonymousSequence = 0; - public override Task OnDisconnected(bool stopCalled) + public override async Task OnDisconnectedAsync(Exception ?ex) { string userName = Context.User?.Identity.Name; if (userName != null) { var user = _dbContext.Users.FirstOrDefault(u => u.UserName == userName); var userId = user.Id; - Clients.Group(ChatHubConstants.HubGroupFollowingPrefix + userId).notifyUser(NotificationTypes.DisConnected, userName, null); + await Clients.Group(ChatHubConstants.HubGroupFollowingPrefix + userId).SendAsync("notifyUser", NotificationTypes.DisConnected, userName, null); _cxManager.OnDisctonnected(Context.ConnectionId); } - return base.OnDisconnected(stopCalled); - } - - public override Task OnReconnected() - { - - var isCop = Context.User?.IsInRole(Constants.AdminGroupName) ?? false; - var userName = setUserName(); - if (Context.User != null) if (Context.User.Identity.IsAuthenticated) - { - Clients.Group("authenticated").notifyUser(NotificationTypes.Reconnected, userName, "reconnected"); - } - _cxManager.OnConnected(Context.ConnectionId, isCop); - return base.OnReconnected(); + await base.OnDisconnectedAsync(ex); } - public void Nick(string nickName) + + public async Task Nick(string nickName) { if (!InputValidator.ValidateUserName(nickName)) return; var candidate = "?" + nickName; if (_cxManager.IsConnected(candidate)) { - NotifyUser(NotificationTypes.ExistingUserName, nickName, "aborting"); + await NotifyUser(NotificationTypes.ExistingUserName, nickName, "aborting"); return; } _cxManager.SetUserName( Context.ConnectionId, candidate); @@ -168,7 +155,7 @@ namespace Yavsc return _cxManager.IsPresent(roomName, userName); } - public ChatRoomInfo Join(string roomName) + public async Task Join(string roomName) { _logger.LogInformation($"Join:{roomName}"); if (!InputValidator.ValidateRoomName(roomName)) @@ -179,13 +166,13 @@ namespace Yavsc var roomGroupName = ChatHubConstants.HubGroupRomsPrefix + roomName; var user = _cxManager.GetUserName(Context.ConnectionId); - Groups.Add(Context.ConnectionId, roomGroupName); + await Groups.AddToGroupAsync(Context.ConnectionId, roomGroupName); ChatRoomInfo chanInfo; if (!_cxManager.IsPresent(roomName, user)) { _logger.LogInformation($"Joining"); chanInfo = _cxManager.Join(roomName, Context.ConnectionId); - Clients.Group(roomGroupName).notifyRoom(NotificationTypes.UserJoin, roomName, user); + await Clients.Group(roomGroupName).SendAsync("notifyRoom", NotificationTypes.UserJoin, roomName, user); } else { _logger.LogInformation($"already present"); // in case in an additional connection, @@ -235,7 +222,7 @@ namespace Yavsc } [Authorize] - public void Kick(string roomName, string userName, string reason) + public async Task Kick(string roomName, string userName, string reason) { if (!InputValidator.ValidateRoomName(roomName)) return ; if (!InputValidator.ValidateUserName(userName)) return ; @@ -255,8 +242,8 @@ namespace Yavsc } var ukeys = _cxManager.GetConnexionIds(userName); if (ukeys!=null) foreach(var ukey in ukeys) - Groups.Remove(ukey, roomGroupName); - Clients.Group(roomGroupName).notifyRoom(NotificationTypes.Kick, roomName, $"{userName}: {reason}"); + await Groups.RemoveFromGroupAsync(ukey, roomGroupName); + await Clients.Group(roomGroupName).SendAsync("notifyRoom", NotificationTypes.Kick, roomName, $"{userName}: {reason}"); } [Authorize] @@ -286,8 +273,8 @@ namespace Yavsc var roomGroupName = ChatHubConstants.HubGroupRomsPrefix + roomName; var group = Clients.Group(roomGroupName); var userName = _cxManager.GetUserName(Context.ConnectionId); - group.notifyRoom(NotificationTypes.UserPart, roomName, $"{userName}: {reason}"); - Groups.Remove(Context.ConnectionId, roomGroupName); + group.SendAsync("notifyRoom", NotificationTypes.UserPart, roomName, $"{userName}: {reason}"); + Groups.RemoveFromGroupAsync(Context.ConnectionId, roomGroupName); } else { _logger.LogError("Could not part"); @@ -300,7 +287,7 @@ namespace Yavsc _logger.LogError($"NotifyErrorToCallerInRoom: {room}, {reason}"); } - public void Send(string roomName, string message) + public async Task Send(string roomName, string message) { _logger.LogInformation($"Send {roomName} {message}"); if (!InputValidator.ValidateRoomName(roomName)) { @@ -328,21 +315,22 @@ namespace Yavsc NotifyUserInRoom(NotificationTypes.Error, roomName, notSentMsg); return; } - Clients.Group(groupname).addMessage(userName, roomName, message); + await Clients.Group(groupname).SendAsync("addMessage", userName, roomName, message); } - void NotifyUser(string type, string targetId, string message) + async Task NotifyUser(string type, string targetId, string message) { _logger.LogInformation("notifying user {type} {targetId} : {message}"); - Clients.Caller.notifyUser(type, targetId, message); + await Clients.Caller.SendAsync("notifyUser", type, targetId, message); } - void NotifyUserInRoom(string type, string room, string message) + + async Task NotifyUserInRoom(string type, string room, string message) { - Clients.Caller.notifyUserInRoom(type, room, message); + await Clients.Caller.SendAsync("notifyUserInRoom", type, room, message); } [Authorize] - public void SendPV(string userName, string message) + public async Task SendPV(string userName, string message) { _logger.LogInformation($"Sending pv to {userName}"); @@ -370,7 +358,7 @@ namespace Yavsc if (bl.Count() > 0) { _logger.LogError($"Black listed : {Context.User.Identity.Name}"); - NotifyUser(NotificationTypes.PrivateMessageDenied, userName, "you are black listed."); + await NotifyUser(NotificationTypes.PrivateMessageDenied, userName, "you are black listed."); return; } _logger.LogInformation("Sender is no black listed"); @@ -385,18 +373,18 @@ namespace Yavsc _logger.LogInformation($"cx: {connectionId}"); var cli = Clients.Client(connectionId); _logger.LogInformation($"cli: {cli.ToString()}"); - cli.addPV(Context.User.Identity.Name, message); + await cli.SendAsync("addPV", Context.User.Identity.Name, message); _logger.LogInformation($"Sent pv to cx {connectionId}"); } } [Authorize] - public void SendStream(string connectionId, long streamId, string message) + public async Task SendStream(string connectionId, long streamId, string message) { if (!InputValidator.ValidateMessage(message)) return; var sender = Context.User.Identity.Name; var cli = Clients.Client(connectionId); - cli.addStreamInfo(sender, streamId, message); + await cli.SendAsync("addStreamInfo", sender, streamId, message); } diff --git a/src/Yavsc/Interfaces/ILiveProcessor.cs b/src/Yavsc/Interfaces/ILiveProcessor.cs index ff4d3dc4..d2d7f21e 100644 --- a/src/Yavsc/Interfaces/ILiveProcessor.cs +++ b/src/Yavsc/Interfaces/ILiveProcessor.cs @@ -1,6 +1,6 @@ using System.Collections.Concurrent; using System.Threading.Tasks; -using Microsoft.AspNet.Http; +using Microsoft.AspNetCore.Http; using Yavsc.Models; using Yavsc.ViewModels.Streaming; diff --git a/src/Yavsc/Migrations/2016/20160315144017_init.Designer.cs b/src/Yavsc/Migrations/2016/20160315144017_init.Designer.cs index 884eef24..173e3844 100644 --- a/src/Yavsc/Migrations/2016/20160315144017_init.Designer.cs +++ b/src/Yavsc/Migrations/2016/20160315144017_init.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2016/20160315144017_init.cs b/src/Yavsc/Migrations/2016/20160315144017_init.cs index c8e4fa71..155eff75 100644 --- a/src/Yavsc/Migrations/2016/20160315144017_init.cs +++ b/src/Yavsc/Migrations/2016/20160315144017_init.cs @@ -1,6 +1,7 @@ using System; -using Microsoft.Data.Entity.Migrations; - +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { public partial class init : Migration diff --git a/src/Yavsc/Migrations/2016/20160317215718_command.Designer.cs b/src/Yavsc/Migrations/2016/20160317215718_command.Designer.cs index d4471a74..148e3446 100644 --- a/src/Yavsc/Migrations/2016/20160317215718_command.Designer.cs +++ b/src/Yavsc/Migrations/2016/20160317215718_command.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2016/20160317215718_command.cs b/src/Yavsc/Migrations/2016/20160317215718_command.cs index 2b43e585..78e8ffbf 100644 --- a/src/Yavsc/Migrations/2016/20160317215718_command.cs +++ b/src/Yavsc/Migrations/2016/20160317215718_command.cs @@ -1,5 +1,7 @@ -using System; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/2016/20160320170252_bank.Designer.cs b/src/Yavsc/Migrations/2016/20160320170252_bank.Designer.cs index 695751b8..e6e5b8cf 100644 --- a/src/Yavsc/Migrations/2016/20160320170252_bank.Designer.cs +++ b/src/Yavsc/Migrations/2016/20160320170252_bank.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2016/20160320170252_bank.cs b/src/Yavsc/Migrations/2016/20160320170252_bank.cs index 7100e0d9..d2252452 100644 --- a/src/Yavsc/Migrations/2016/20160320170252_bank.cs +++ b/src/Yavsc/Migrations/2016/20160320170252_bank.cs @@ -1,6 +1,7 @@ -using System; -using Microsoft.Data.Entity.Migrations; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { public partial class bank : Migration diff --git a/src/Yavsc/Migrations/2016/20160322144500_contact.Designer.cs b/src/Yavsc/Migrations/2016/20160322144500_contact.Designer.cs index a85e8b65..43f6377f 100644 --- a/src/Yavsc/Migrations/2016/20160322144500_contact.Designer.cs +++ b/src/Yavsc/Migrations/2016/20160322144500_contact.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2016/20160322144500_contact.cs b/src/Yavsc/Migrations/2016/20160322144500_contact.cs index 23b3b52f..c6a3b294 100644 --- a/src/Yavsc/Migrations/2016/20160322144500_contact.cs +++ b/src/Yavsc/Migrations/2016/20160322144500_contact.cs @@ -1,5 +1,7 @@ -using Microsoft.Data.Entity.Migrations; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/2016/20160322152206_balance.Designer.cs b/src/Yavsc/Migrations/2016/20160322152206_balance.Designer.cs index aa8b4a65..1eb9aa72 100644 --- a/src/Yavsc/Migrations/2016/20160322152206_balance.Designer.cs +++ b/src/Yavsc/Migrations/2016/20160322152206_balance.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2016/20160322152206_balance.cs b/src/Yavsc/Migrations/2016/20160322152206_balance.cs index 101a6905..976034ac 100644 --- a/src/Yavsc/Migrations/2016/20160322152206_balance.cs +++ b/src/Yavsc/Migrations/2016/20160322152206_balance.cs @@ -1,4 +1,7 @@ -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/2016/20160401233357_circle.Designer.cs b/src/Yavsc/Migrations/2016/20160401233357_circle.Designer.cs index f9e22eed..a420d56f 100644 --- a/src/Yavsc/Migrations/2016/20160401233357_circle.Designer.cs +++ b/src/Yavsc/Migrations/2016/20160401233357_circle.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2016/20160401233357_circle.cs b/src/Yavsc/Migrations/2016/20160401233357_circle.cs index 677ed91b..1f4c4970 100644 --- a/src/Yavsc/Migrations/2016/20160401233357_circle.cs +++ b/src/Yavsc/Migrations/2016/20160401233357_circle.cs @@ -1,5 +1,7 @@ -using System; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/2016/20160402135146_calendar.Designer.cs b/src/Yavsc/Migrations/2016/20160402135146_calendar.Designer.cs index d993d7b7..db44795a 100644 --- a/src/Yavsc/Migrations/2016/20160402135146_calendar.Designer.cs +++ b/src/Yavsc/Migrations/2016/20160402135146_calendar.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2016/20160402135146_calendar.cs b/src/Yavsc/Migrations/2016/20160402135146_calendar.cs index ef37e8b0..bcb370a0 100644 --- a/src/Yavsc/Migrations/2016/20160402135146_calendar.cs +++ b/src/Yavsc/Migrations/2016/20160402135146_calendar.cs @@ -1,4 +1,7 @@ -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/2016/20160404110708_files.Designer.cs b/src/Yavsc/Migrations/2016/20160404110708_files.Designer.cs index 94cc4a7e..261ebd9b 100644 --- a/src/Yavsc/Migrations/2016/20160404110708_files.Designer.cs +++ b/src/Yavsc/Migrations/2016/20160404110708_files.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2016/20160404110708_files.cs b/src/Yavsc/Migrations/2016/20160404110708_files.cs index c0fd9b5d..62010a29 100644 --- a/src/Yavsc/Migrations/2016/20160404110708_files.cs +++ b/src/Yavsc/Migrations/2016/20160404110708_files.cs @@ -1,5 +1,7 @@ -using Microsoft.Data.Entity.Migrations; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/2016/20160404121446_estimate.Designer.cs b/src/Yavsc/Migrations/2016/20160404121446_estimate.Designer.cs index 05b48374..1a00b82f 100644 --- a/src/Yavsc/Migrations/2016/20160404121446_estimate.Designer.cs +++ b/src/Yavsc/Migrations/2016/20160404121446_estimate.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2016/20160404121446_estimate.cs b/src/Yavsc/Migrations/2016/20160404121446_estimate.cs index ed87ce1c..b4c17b52 100644 --- a/src/Yavsc/Migrations/2016/20160404121446_estimate.cs +++ b/src/Yavsc/Migrations/2016/20160404121446_estimate.cs @@ -1,4 +1,7 @@ -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/2016/20160404130359_estimateCommand.Designer.cs b/src/Yavsc/Migrations/2016/20160404130359_estimateCommand.Designer.cs index a8d1eec5..1cb357ae 100644 --- a/src/Yavsc/Migrations/2016/20160404130359_estimateCommand.Designer.cs +++ b/src/Yavsc/Migrations/2016/20160404130359_estimateCommand.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2016/20160404130359_estimateCommand.cs b/src/Yavsc/Migrations/2016/20160404130359_estimateCommand.cs index 7943f841..1d3108a1 100644 --- a/src/Yavsc/Migrations/2016/20160404130359_estimateCommand.cs +++ b/src/Yavsc/Migrations/2016/20160404130359_estimateCommand.cs @@ -1,4 +1,7 @@ -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/2016/20160405091432_booking.Designer.cs b/src/Yavsc/Migrations/2016/20160405091432_booking.Designer.cs index 941bd26b..59537d78 100644 --- a/src/Yavsc/Migrations/2016/20160405091432_booking.Designer.cs +++ b/src/Yavsc/Migrations/2016/20160405091432_booking.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2016/20160405091432_booking.cs b/src/Yavsc/Migrations/2016/20160405091432_booking.cs index db3a482f..50654a1c 100644 --- a/src/Yavsc/Migrations/2016/20160405091432_booking.cs +++ b/src/Yavsc/Migrations/2016/20160405091432_booking.cs @@ -1,5 +1,7 @@ -using System; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/2016/20160407112403_dailycost.Designer.cs b/src/Yavsc/Migrations/2016/20160407112403_dailycost.Designer.cs index 96a94bca..43affc91 100644 --- a/src/Yavsc/Migrations/2016/20160407112403_dailycost.Designer.cs +++ b/src/Yavsc/Migrations/2016/20160407112403_dailycost.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2016/20160407112403_dailycost.cs b/src/Yavsc/Migrations/2016/20160407112403_dailycost.cs index 2775c73e..b79dde51 100644 --- a/src/Yavsc/Migrations/2016/20160407112403_dailycost.cs +++ b/src/Yavsc/Migrations/2016/20160407112403_dailycost.cs @@ -1,5 +1,7 @@ -using Microsoft.Data.Entity.Migrations; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { public partial class dailycost : Migration diff --git a/src/Yavsc/Migrations/2016/20160418114001_commandCreation.Designer.cs b/src/Yavsc/Migrations/2016/20160418114001_commandCreation.Designer.cs index b1e15885..a5e518f1 100644 --- a/src/Yavsc/Migrations/2016/20160418114001_commandCreation.Designer.cs +++ b/src/Yavsc/Migrations/2016/20160418114001_commandCreation.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2016/20160418114001_commandCreation.cs b/src/Yavsc/Migrations/2016/20160418114001_commandCreation.cs index 419017ad..e1f48ae5 100644 --- a/src/Yavsc/Migrations/2016/20160418114001_commandCreation.cs +++ b/src/Yavsc/Migrations/2016/20160418114001_commandCreation.cs @@ -1,5 +1,7 @@ -using System; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/2016/20160427123737_perfoffer.Designer.cs b/src/Yavsc/Migrations/2016/20160427123737_perfoffer.Designer.cs index fc60d2ff..4aeea15c 100644 --- a/src/Yavsc/Migrations/2016/20160427123737_perfoffer.Designer.cs +++ b/src/Yavsc/Migrations/2016/20160427123737_perfoffer.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2016/20160427123737_perfoffer.cs b/src/Yavsc/Migrations/2016/20160427123737_perfoffer.cs index 9048c865..bfd21dee 100644 --- a/src/Yavsc/Migrations/2016/20160427123737_perfoffer.cs +++ b/src/Yavsc/Migrations/2016/20160427123737_perfoffer.cs @@ -1,5 +1,7 @@ -using Microsoft.Data.Entity.Migrations; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { public partial class perfoffer : Migration diff --git a/src/Yavsc/Migrations/2016/20160506154628_siren.Designer.cs b/src/Yavsc/Migrations/2016/20160506154628_siren.Designer.cs index b2b83386..3c2433ff 100644 --- a/src/Yavsc/Migrations/2016/20160506154628_siren.Designer.cs +++ b/src/Yavsc/Migrations/2016/20160506154628_siren.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2016/20160506154628_siren.cs b/src/Yavsc/Migrations/2016/20160506154628_siren.cs index 497f9294..430ac2ef 100644 --- a/src/Yavsc/Migrations/2016/20160506154628_siren.cs +++ b/src/Yavsc/Migrations/2016/20160506154628_siren.cs @@ -1,4 +1,7 @@ -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/2016/20160515142434_tokenExpiresIn.Designer.cs b/src/Yavsc/Migrations/2016/20160515142434_tokenExpiresIn.Designer.cs index 239e8fcd..45d384a5 100644 --- a/src/Yavsc/Migrations/2016/20160515142434_tokenExpiresIn.Designer.cs +++ b/src/Yavsc/Migrations/2016/20160515142434_tokenExpiresIn.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2016/20160515142434_tokenExpiresIn.cs b/src/Yavsc/Migrations/2016/20160515142434_tokenExpiresIn.cs index c88f509b..3cfa1dc4 100644 --- a/src/Yavsc/Migrations/2016/20160515142434_tokenExpiresIn.cs +++ b/src/Yavsc/Migrations/2016/20160515142434_tokenExpiresIn.cs @@ -1,5 +1,7 @@ -using Microsoft.Data.Entity.Migrations; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { public partial class tokenExpiresIn : Migration diff --git a/src/Yavsc/Migrations/2016/20160529205859_ModeratorGroupName.Designer.cs b/src/Yavsc/Migrations/2016/20160529205859_ModeratorGroupName.Designer.cs index 7fb19c93..d5bbcbb3 100644 --- a/src/Yavsc/Migrations/2016/20160529205859_ModeratorGroupName.Designer.cs +++ b/src/Yavsc/Migrations/2016/20160529205859_ModeratorGroupName.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2016/20160529205859_ModeratorGroupName.cs b/src/Yavsc/Migrations/2016/20160529205859_ModeratorGroupName.cs index e172ea24..0825cb6a 100644 --- a/src/Yavsc/Migrations/2016/20160529205859_ModeratorGroupName.cs +++ b/src/Yavsc/Migrations/2016/20160529205859_ModeratorGroupName.cs @@ -1,5 +1,7 @@ -using Microsoft.Data.Entity.Migrations; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { public partial class ModeratorGroupName : Migration diff --git a/src/Yavsc/Migrations/2016/20160610153353_client.Designer.cs b/src/Yavsc/Migrations/2016/20160610153353_client.Designer.cs index 971f52c8..3ffca6b9 100644 --- a/src/Yavsc/Migrations/2016/20160610153353_client.Designer.cs +++ b/src/Yavsc/Migrations/2016/20160610153353_client.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2016/20160610153353_client.cs b/src/Yavsc/Migrations/2016/20160610153353_client.cs index ea79a563..c719cbd7 100644 --- a/src/Yavsc/Migrations/2016/20160610153353_client.cs +++ b/src/Yavsc/Migrations/2016/20160610153353_client.cs @@ -1,5 +1,7 @@ -using System; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/2016/20160613142037_devices.Designer.cs b/src/Yavsc/Migrations/2016/20160613142037_devices.Designer.cs index dc57c4ac..87c0c383 100644 --- a/src/Yavsc/Migrations/2016/20160613142037_devices.Designer.cs +++ b/src/Yavsc/Migrations/2016/20160613142037_devices.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2016/20160613142037_devices.cs b/src/Yavsc/Migrations/2016/20160613142037_devices.cs index 708a28eb..5b414b84 100644 --- a/src/Yavsc/Migrations/2016/20160613142037_devices.cs +++ b/src/Yavsc/Migrations/2016/20160613142037_devices.cs @@ -1,6 +1,7 @@ -using System; -using Microsoft.Data.Entity.Migrations; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { public partial class devices : Migration diff --git a/src/Yavsc/Migrations/2016/20160614010545_bookquery.Designer.cs b/src/Yavsc/Migrations/2016/20160614010545_bookquery.Designer.cs index 7c12d44c..09b0ad4f 100644 --- a/src/Yavsc/Migrations/2016/20160614010545_bookquery.Designer.cs +++ b/src/Yavsc/Migrations/2016/20160614010545_bookquery.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2016/20160614010545_bookquery.cs b/src/Yavsc/Migrations/2016/20160614010545_bookquery.cs index 0e90975b..109127ef 100644 --- a/src/Yavsc/Migrations/2016/20160614010545_bookquery.cs +++ b/src/Yavsc/Migrations/2016/20160614010545_bookquery.cs @@ -1,6 +1,7 @@ -using System; -using Microsoft.Data.Entity.Migrations; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { public partial class bookquery : Migration diff --git a/src/Yavsc/Migrations/2016/20160702195348_GCMinfos.Designer.cs b/src/Yavsc/Migrations/2016/20160702195348_GCMinfos.Designer.cs index a95d5393..9c3cae57 100644 --- a/src/Yavsc/Migrations/2016/20160702195348_GCMinfos.Designer.cs +++ b/src/Yavsc/Migrations/2016/20160702195348_GCMinfos.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2016/20160702195348_GCMinfos.cs b/src/Yavsc/Migrations/2016/20160702195348_GCMinfos.cs index 111bdd0a..fdcc40ce 100644 --- a/src/Yavsc/Migrations/2016/20160702195348_GCMinfos.cs +++ b/src/Yavsc/Migrations/2016/20160702195348_GCMinfos.cs @@ -1,4 +1,7 @@ -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/2016/20160723164231_GCMRedDate.Designer.cs b/src/Yavsc/Migrations/2016/20160723164231_GCMRedDate.Designer.cs index a0221f1c..52a5b8f8 100644 --- a/src/Yavsc/Migrations/2016/20160723164231_GCMRedDate.Designer.cs +++ b/src/Yavsc/Migrations/2016/20160723164231_GCMRedDate.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2016/20160723164231_GCMRedDate.cs b/src/Yavsc/Migrations/2016/20160723164231_GCMRedDate.cs index 32babb83..e9d5bb8b 100644 --- a/src/Yavsc/Migrations/2016/20160723164231_GCMRedDate.cs +++ b/src/Yavsc/Migrations/2016/20160723164231_GCMRedDate.cs @@ -1,5 +1,7 @@ -using System; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/2016/20160725145306_estimates.Designer.cs b/src/Yavsc/Migrations/2016/20160725145306_estimates.Designer.cs index dda1fe31..6037b7d9 100644 --- a/src/Yavsc/Migrations/2016/20160725145306_estimates.Designer.cs +++ b/src/Yavsc/Migrations/2016/20160725145306_estimates.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2016/20160725145306_estimates.cs b/src/Yavsc/Migrations/2016/20160725145306_estimates.cs index fb56ae8d..bd5e5ae3 100644 --- a/src/Yavsc/Migrations/2016/20160725145306_estimates.cs +++ b/src/Yavsc/Migrations/2016/20160725145306_estimates.cs @@ -1,5 +1,7 @@ -using System; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/2016/20160726131331_performerIdTypo.Designer.cs b/src/Yavsc/Migrations/2016/20160726131331_performerIdTypo.Designer.cs index b4edd63b..e53915e2 100644 --- a/src/Yavsc/Migrations/2016/20160726131331_performerIdTypo.Designer.cs +++ b/src/Yavsc/Migrations/2016/20160726131331_performerIdTypo.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2016/20160726131331_performerIdTypo.cs b/src/Yavsc/Migrations/2016/20160726131331_performerIdTypo.cs index a9a5ef2e..1b684984 100644 --- a/src/Yavsc/Migrations/2016/20160726131331_performerIdTypo.cs +++ b/src/Yavsc/Migrations/2016/20160726131331_performerIdTypo.cs @@ -1,4 +1,7 @@ -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/2016/20160726133002_otherOrtho.Designer.cs b/src/Yavsc/Migrations/2016/20160726133002_otherOrtho.Designer.cs index bab398ca..6bd06cec 100644 --- a/src/Yavsc/Migrations/2016/20160726133002_otherOrtho.Designer.cs +++ b/src/Yavsc/Migrations/2016/20160726133002_otherOrtho.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2016/20160726133002_otherOrtho.cs b/src/Yavsc/Migrations/2016/20160726133002_otherOrtho.cs index 32ba37ae..4d905c90 100644 --- a/src/Yavsc/Migrations/2016/20160726133002_otherOrtho.cs +++ b/src/Yavsc/Migrations/2016/20160726133002_otherOrtho.cs @@ -1,5 +1,7 @@ -using Microsoft.Data.Entity.Migrations; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { public partial class otherOrtho : Migration diff --git a/src/Yavsc/Migrations/2016/20160726161530_ExceptionsSIREN.Designer.cs b/src/Yavsc/Migrations/2016/20160726161530_ExceptionsSIREN.Designer.cs index aa82fbaa..254804a6 100644 --- a/src/Yavsc/Migrations/2016/20160726161530_ExceptionsSIREN.Designer.cs +++ b/src/Yavsc/Migrations/2016/20160726161530_ExceptionsSIREN.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2016/20160726161530_ExceptionsSIREN.cs b/src/Yavsc/Migrations/2016/20160726161530_ExceptionsSIREN.cs index bba58e93..0583e557 100644 --- a/src/Yavsc/Migrations/2016/20160726161530_ExceptionsSIREN.cs +++ b/src/Yavsc/Migrations/2016/20160726161530_ExceptionsSIREN.cs @@ -1,5 +1,7 @@ -using Microsoft.Data.Entity.Migrations; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { public partial class ExceptionsSIREN : Migration diff --git a/src/Yavsc/Migrations/2016/20160802143258_bcontentornot.Designer.cs b/src/Yavsc/Migrations/2016/20160802143258_bcontentornot.Designer.cs index 754cc24a..c796f99c 100644 --- a/src/Yavsc/Migrations/2016/20160802143258_bcontentornot.Designer.cs +++ b/src/Yavsc/Migrations/2016/20160802143258_bcontentornot.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2016/20160802143258_bcontentornot.cs b/src/Yavsc/Migrations/2016/20160802143258_bcontentornot.cs index c1bb6fa4..738e530a 100644 --- a/src/Yavsc/Migrations/2016/20160802143258_bcontentornot.cs +++ b/src/Yavsc/Migrations/2016/20160802143258_bcontentornot.cs @@ -1,5 +1,7 @@ -using Microsoft.Data.Entity.Migrations; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { public partial class bcontentornot : Migration diff --git a/src/Yavsc/Migrations/2016/20160802145351_camelCaseBlog.Designer.cs b/src/Yavsc/Migrations/2016/20160802145351_camelCaseBlog.Designer.cs index 7cf895c0..67094ee2 100644 --- a/src/Yavsc/Migrations/2016/20160802145351_camelCaseBlog.Designer.cs +++ b/src/Yavsc/Migrations/2016/20160802145351_camelCaseBlog.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2016/20160802145351_camelCaseBlog.cs b/src/Yavsc/Migrations/2016/20160802145351_camelCaseBlog.cs index 6c538f1c..eeaaec81 100644 --- a/src/Yavsc/Migrations/2016/20160802145351_camelCaseBlog.cs +++ b/src/Yavsc/Migrations/2016/20160802145351_camelCaseBlog.cs @@ -1,5 +1,7 @@ -using Microsoft.Data.Entity.Migrations; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { public partial class camelCaseBlog : Migration diff --git a/src/Yavsc/Migrations/2016/20160901145646_products.Designer.cs b/src/Yavsc/Migrations/2016/20160901145646_products.Designer.cs index e0e98f35..3ec0ed83 100644 --- a/src/Yavsc/Migrations/2016/20160901145646_products.Designer.cs +++ b/src/Yavsc/Migrations/2016/20160901145646_products.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2016/20160901145646_products.cs b/src/Yavsc/Migrations/2016/20160901145646_products.cs index 5b2a91a6..4f66b9cd 100644 --- a/src/Yavsc/Migrations/2016/20160901145646_products.cs +++ b/src/Yavsc/Migrations/2016/20160901145646_products.cs @@ -1,5 +1,7 @@ -using Microsoft.Data.Entity.Migrations; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { public partial class products : Migration diff --git a/src/Yavsc/Migrations/2016/20160905095708_tags.Designer.cs b/src/Yavsc/Migrations/2016/20160905095708_tags.Designer.cs index df99f552..cf698817 100644 --- a/src/Yavsc/Migrations/2016/20160905095708_tags.Designer.cs +++ b/src/Yavsc/Migrations/2016/20160905095708_tags.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2016/20160905095708_tags.cs b/src/Yavsc/Migrations/2016/20160905095708_tags.cs index ec6f1b22..14e3882b 100644 --- a/src/Yavsc/Migrations/2016/20160905095708_tags.cs +++ b/src/Yavsc/Migrations/2016/20160905095708_tags.cs @@ -1,4 +1,7 @@ -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/2016/20160916075415_estimateFreeFromCatalog.Designer.cs b/src/Yavsc/Migrations/2016/20160916075415_estimateFreeFromCatalog.Designer.cs index 193ceeaa..50e03afa 100644 --- a/src/Yavsc/Migrations/2016/20160916075415_estimateFreeFromCatalog.Designer.cs +++ b/src/Yavsc/Migrations/2016/20160916075415_estimateFreeFromCatalog.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2016/20160916075415_estimateFreeFromCatalog.cs b/src/Yavsc/Migrations/2016/20160916075415_estimateFreeFromCatalog.cs index 1ad19655..8e7191c6 100644 --- a/src/Yavsc/Migrations/2016/20160916075415_estimateFreeFromCatalog.cs +++ b/src/Yavsc/Migrations/2016/20160916075415_estimateFreeFromCatalog.cs @@ -1,4 +1,7 @@ -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/2016/20160917010249_yaev.Designer.cs b/src/Yavsc/Migrations/2016/20160917010249_yaev.Designer.cs index d537446e..d3696b2e 100644 --- a/src/Yavsc/Migrations/2016/20160917010249_yaev.Designer.cs +++ b/src/Yavsc/Migrations/2016/20160917010249_yaev.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2016/20160917010249_yaev.cs b/src/Yavsc/Migrations/2016/20160917010249_yaev.cs index ef4720f5..99e0d0d3 100644 --- a/src/Yavsc/Migrations/2016/20160917010249_yaev.cs +++ b/src/Yavsc/Migrations/2016/20160917010249_yaev.cs @@ -1,5 +1,7 @@ -using Microsoft.Data.Entity.Migrations; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { public partial class yaev : Migration diff --git a/src/Yavsc/Migrations/2016/20160920215459_avatar.Designer.cs b/src/Yavsc/Migrations/2016/20160920215459_avatar.Designer.cs index 8c469b1e..ca21bc76 100644 --- a/src/Yavsc/Migrations/2016/20160920215459_avatar.Designer.cs +++ b/src/Yavsc/Migrations/2016/20160920215459_avatar.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2016/20160920215459_avatar.cs b/src/Yavsc/Migrations/2016/20160920215459_avatar.cs index d98a4b20..54216a73 100644 --- a/src/Yavsc/Migrations/2016/20160920215459_avatar.cs +++ b/src/Yavsc/Migrations/2016/20160920215459_avatar.cs @@ -1,5 +1,7 @@ -using Microsoft.Data.Entity.Migrations; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { public partial class avatar : Migration diff --git a/src/Yavsc/Migrations/2016/20161010102616_recontact.Designer.cs b/src/Yavsc/Migrations/2016/20161010102616_recontact.Designer.cs index c2d41f25..5ab8893d 100644 --- a/src/Yavsc/Migrations/2016/20161010102616_recontact.Designer.cs +++ b/src/Yavsc/Migrations/2016/20161010102616_recontact.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2016/20161010102616_recontact.cs b/src/Yavsc/Migrations/2016/20161010102616_recontact.cs index 6cd94920..7de0b144 100644 --- a/src/Yavsc/Migrations/2016/20161010102616_recontact.cs +++ b/src/Yavsc/Migrations/2016/20161010102616_recontact.cs @@ -1,5 +1,7 @@ -using Microsoft.Data.Entity.Migrations; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { public partial class recontact : Migration diff --git a/src/Yavsc/Migrations/2016/20161020143022_estimateClientApprouval.Designer.cs b/src/Yavsc/Migrations/2016/20161020143022_estimateClientApprouval.Designer.cs index 027d1c0b..9f933215 100644 --- a/src/Yavsc/Migrations/2016/20161020143022_estimateClientApprouval.Designer.cs +++ b/src/Yavsc/Migrations/2016/20161020143022_estimateClientApprouval.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2016/20161020143022_estimateClientApprouval.cs b/src/Yavsc/Migrations/2016/20161020143022_estimateClientApprouval.cs index 0f8a62ad..834b3998 100644 --- a/src/Yavsc/Migrations/2016/20161020143022_estimateClientApprouval.cs +++ b/src/Yavsc/Migrations/2016/20161020143022_estimateClientApprouval.cs @@ -1,5 +1,7 @@ -using System; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/2016/20161020212947_userAddress.Designer.cs b/src/Yavsc/Migrations/2016/20161020212947_userAddress.Designer.cs index 08865733..6288e0dc 100644 --- a/src/Yavsc/Migrations/2016/20161020212947_userAddress.Designer.cs +++ b/src/Yavsc/Migrations/2016/20161020212947_userAddress.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2016/20161020212947_userAddress.cs b/src/Yavsc/Migrations/2016/20161020212947_userAddress.cs index 9305ad21..dd52dfb1 100644 --- a/src/Yavsc/Migrations/2016/20161020212947_userAddress.cs +++ b/src/Yavsc/Migrations/2016/20161020212947_userAddress.cs @@ -1,6 +1,7 @@ -using Microsoft.Data.Entity.Migrations; - +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { public partial class userAddress : Migration diff --git a/src/Yavsc/Migrations/2016/20161021153306_estimateLines.Designer.cs b/src/Yavsc/Migrations/2016/20161021153306_estimateLines.Designer.cs index 5eab2c3a..1d888725 100644 --- a/src/Yavsc/Migrations/2016/20161021153306_estimateLines.Designer.cs +++ b/src/Yavsc/Migrations/2016/20161021153306_estimateLines.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2016/20161021153306_estimateLines.cs b/src/Yavsc/Migrations/2016/20161021153306_estimateLines.cs index 85e5b151..9c20a25d 100644 --- a/src/Yavsc/Migrations/2016/20161021153306_estimateLines.cs +++ b/src/Yavsc/Migrations/2016/20161021153306_estimateLines.cs @@ -1,6 +1,8 @@ -using Microsoft.Data.Entity.Migrations; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { public partial class estimateLines : Migration diff --git a/src/Yavsc/Migrations/2016/20161101234703_chatConnection.Designer.cs b/src/Yavsc/Migrations/2016/20161101234703_chatConnection.Designer.cs index 1a4be8e8..05475d47 100644 --- a/src/Yavsc/Migrations/2016/20161101234703_chatConnection.Designer.cs +++ b/src/Yavsc/Migrations/2016/20161101234703_chatConnection.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2016/20161101234703_chatConnection.cs b/src/Yavsc/Migrations/2016/20161101234703_chatConnection.cs index 8e76f3a4..ab50e752 100644 --- a/src/Yavsc/Migrations/2016/20161101234703_chatConnection.cs +++ b/src/Yavsc/Migrations/2016/20161101234703_chatConnection.cs @@ -1,5 +1,7 @@ -using Microsoft.Data.Entity.Migrations; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/2016/20161102132129_fixCxOwner.Designer.cs b/src/Yavsc/Migrations/2016/20161102132129_fixCxOwner.Designer.cs index fa762772..088b1dc7 100644 --- a/src/Yavsc/Migrations/2016/20161102132129_fixCxOwner.Designer.cs +++ b/src/Yavsc/Migrations/2016/20161102132129_fixCxOwner.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2016/20161102132129_fixCxOwner.cs b/src/Yavsc/Migrations/2016/20161102132129_fixCxOwner.cs index b482299d..c31b7fc9 100644 --- a/src/Yavsc/Migrations/2016/20161102132129_fixCxOwner.cs +++ b/src/Yavsc/Migrations/2016/20161102132129_fixCxOwner.cs @@ -1,5 +1,7 @@ -using Microsoft.Data.Entity.Migrations; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/2016/20161102133253_fix2CxOwner.Designer.cs b/src/Yavsc/Migrations/2016/20161102133253_fix2CxOwner.Designer.cs index 050a1a82..48db06c8 100644 --- a/src/Yavsc/Migrations/2016/20161102133253_fix2CxOwner.Designer.cs +++ b/src/Yavsc/Migrations/2016/20161102133253_fix2CxOwner.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2016/20161102133253_fix2CxOwner.cs b/src/Yavsc/Migrations/2016/20161102133253_fix2CxOwner.cs index 4f7673b1..ac1465e5 100644 --- a/src/Yavsc/Migrations/2016/20161102133253_fix2CxOwner.cs +++ b/src/Yavsc/Migrations/2016/20161102133253_fix2CxOwner.cs @@ -1,6 +1,8 @@ -using Microsoft.Data.Entity.Migrations; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { public partial class fix2CxOwner : Migration diff --git a/src/Yavsc/Migrations/2016/20161104090806_bankUserProfile.Designer.cs b/src/Yavsc/Migrations/2016/20161104090806_bankUserProfile.Designer.cs index b548239b..c3345a4d 100644 --- a/src/Yavsc/Migrations/2016/20161104090806_bankUserProfile.Designer.cs +++ b/src/Yavsc/Migrations/2016/20161104090806_bankUserProfile.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2016/20161104090806_bankUserProfile.cs b/src/Yavsc/Migrations/2016/20161104090806_bankUserProfile.cs index 53faa0a9..f447a29a 100644 --- a/src/Yavsc/Migrations/2016/20161104090806_bankUserProfile.cs +++ b/src/Yavsc/Migrations/2016/20161104090806_bankUserProfile.cs @@ -1,4 +1,7 @@ -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/2016/20161104164949_dropEstimateStatus.Designer.cs b/src/Yavsc/Migrations/2016/20161104164949_dropEstimateStatus.Designer.cs index 70d2008c..58df4c0f 100644 --- a/src/Yavsc/Migrations/2016/20161104164949_dropEstimateStatus.Designer.cs +++ b/src/Yavsc/Migrations/2016/20161104164949_dropEstimateStatus.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2016/20161104164949_dropEstimateStatus.cs b/src/Yavsc/Migrations/2016/20161104164949_dropEstimateStatus.cs index d61b3379..b7b139d9 100644 --- a/src/Yavsc/Migrations/2016/20161104164949_dropEstimateStatus.cs +++ b/src/Yavsc/Migrations/2016/20161104164949_dropEstimateStatus.cs @@ -1,6 +1,8 @@ -using Microsoft.Data.Entity.Migrations; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { public partial class dropEstimateStatus : Migration diff --git a/src/Yavsc/Migrations/2016/20161123235323_estimatesignatures.Designer.cs b/src/Yavsc/Migrations/2016/20161123235323_estimatesignatures.Designer.cs index 23143717..d237c3fb 100644 --- a/src/Yavsc/Migrations/2016/20161123235323_estimatesignatures.Designer.cs +++ b/src/Yavsc/Migrations/2016/20161123235323_estimatesignatures.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2016/20161123235323_estimatesignatures.cs b/src/Yavsc/Migrations/2016/20161123235323_estimatesignatures.cs index 20e5190f..1e22c60b 100644 --- a/src/Yavsc/Migrations/2016/20161123235323_estimatesignatures.cs +++ b/src/Yavsc/Migrations/2016/20161123235323_estimatesignatures.cs @@ -1,6 +1,7 @@ -using System; -using Microsoft.Data.Entity.Migrations; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { public partial class estimatesignatures : Migration diff --git a/src/Yavsc/Migrations/2016/20161130084909_diskQuota.Designer.cs b/src/Yavsc/Migrations/2016/20161130084909_diskQuota.Designer.cs index 97f5de91..97647985 100644 --- a/src/Yavsc/Migrations/2016/20161130084909_diskQuota.Designer.cs +++ b/src/Yavsc/Migrations/2016/20161130084909_diskQuota.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2016/20161130084909_diskQuota.cs b/src/Yavsc/Migrations/2016/20161130084909_diskQuota.cs index 957fde7b..d76e0e7a 100644 --- a/src/Yavsc/Migrations/2016/20161130084909_diskQuota.cs +++ b/src/Yavsc/Migrations/2016/20161130084909_diskQuota.cs @@ -1,5 +1,7 @@ -using Microsoft.Data.Entity.Migrations; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { public partial class diskQuota : Migration diff --git a/src/Yavsc/Migrations/2016/20161209121035_bookQueryReason.Designer.cs b/src/Yavsc/Migrations/2016/20161209121035_bookQueryReason.Designer.cs index 3726ab32..01ab96ed 100644 --- a/src/Yavsc/Migrations/2016/20161209121035_bookQueryReason.Designer.cs +++ b/src/Yavsc/Migrations/2016/20161209121035_bookQueryReason.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2016/20161209121035_bookQueryReason.cs b/src/Yavsc/Migrations/2016/20161209121035_bookQueryReason.cs index d1126ce3..74d3bcac 100644 --- a/src/Yavsc/Migrations/2016/20161209121035_bookQueryReason.cs +++ b/src/Yavsc/Migrations/2016/20161209121035_bookQueryReason.cs @@ -1,5 +1,7 @@ -using Microsoft.Data.Entity.Migrations; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { public partial class bookQueryReason : Migration diff --git a/src/Yavsc/Migrations/2016/20161231163016_musicalPreferences.Designer.cs b/src/Yavsc/Migrations/2016/20161231163016_musicalPreferences.Designer.cs index f40f5766..0163fbc1 100644 --- a/src/Yavsc/Migrations/2016/20161231163016_musicalPreferences.Designer.cs +++ b/src/Yavsc/Migrations/2016/20161231163016_musicalPreferences.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2016/20161231163016_musicalPreferences.cs b/src/Yavsc/Migrations/2016/20161231163016_musicalPreferences.cs index 4416e436..332c8153 100644 --- a/src/Yavsc/Migrations/2016/20161231163016_musicalPreferences.cs +++ b/src/Yavsc/Migrations/2016/20161231163016_musicalPreferences.cs @@ -1,5 +1,7 @@ -using Microsoft.Data.Entity.Migrations; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { public partial class musicalPreferences : Migration diff --git a/src/Yavsc/Migrations/2017/20170102140332_musicalTendencies.Designer.cs b/src/Yavsc/Migrations/2017/20170102140332_musicalTendencies.Designer.cs index cfa15e41..2878f1b4 100644 --- a/src/Yavsc/Migrations/2017/20170102140332_musicalTendencies.Designer.cs +++ b/src/Yavsc/Migrations/2017/20170102140332_musicalTendencies.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2017/20170102140332_musicalTendencies.cs b/src/Yavsc/Migrations/2017/20170102140332_musicalTendencies.cs index 730efea8..21dc25c4 100644 --- a/src/Yavsc/Migrations/2017/20170102140332_musicalTendencies.cs +++ b/src/Yavsc/Migrations/2017/20170102140332_musicalTendencies.cs @@ -1,5 +1,7 @@ -using Microsoft.Data.Entity.Migrations; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/2017/20170102152745_locationTypes.Designer.cs b/src/Yavsc/Migrations/2017/20170102152745_locationTypes.Designer.cs index 88300f8d..6c0eccd0 100644 --- a/src/Yavsc/Migrations/2017/20170102152745_locationTypes.Designer.cs +++ b/src/Yavsc/Migrations/2017/20170102152745_locationTypes.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2017/20170102152745_locationTypes.cs b/src/Yavsc/Migrations/2017/20170102152745_locationTypes.cs index e9b8eecf..ec9b234b 100644 --- a/src/Yavsc/Migrations/2017/20170102152745_locationTypes.cs +++ b/src/Yavsc/Migrations/2017/20170102152745_locationTypes.cs @@ -1,5 +1,7 @@ -using Microsoft.Data.Entity.Migrations; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/2017/20170106092028_WFActivityParentAndProfiles.Designer.cs b/src/Yavsc/Migrations/2017/20170106092028_WFActivityParentAndProfiles.Designer.cs index 8f96f8a3..f351a455 100644 --- a/src/Yavsc/Migrations/2017/20170106092028_WFActivityParentAndProfiles.Designer.cs +++ b/src/Yavsc/Migrations/2017/20170106092028_WFActivityParentAndProfiles.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2017/20170106092028_WFActivityParentAndProfiles.cs b/src/Yavsc/Migrations/2017/20170106092028_WFActivityParentAndProfiles.cs index dae3c2d2..0e43dcd4 100644 --- a/src/Yavsc/Migrations/2017/20170106092028_WFActivityParentAndProfiles.cs +++ b/src/Yavsc/Migrations/2017/20170106092028_WFActivityParentAndProfiles.cs @@ -1,5 +1,8 @@ -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/2017/20170106113614_ownerProfile.Designer.cs b/src/Yavsc/Migrations/2017/20170106113614_ownerProfile.Designer.cs index 40cc8471..7c85bd90 100644 --- a/src/Yavsc/Migrations/2017/20170106113614_ownerProfile.Designer.cs +++ b/src/Yavsc/Migrations/2017/20170106113614_ownerProfile.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2017/20170106113614_ownerProfile.cs b/src/Yavsc/Migrations/2017/20170106113614_ownerProfile.cs index 37504b8c..a6f1804b 100644 --- a/src/Yavsc/Migrations/2017/20170106113614_ownerProfile.cs +++ b/src/Yavsc/Migrations/2017/20170106113614_ownerProfile.cs @@ -1,5 +1,8 @@ -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/2017/20170106122307_Instruments.Designer.cs b/src/Yavsc/Migrations/2017/20170106122307_Instruments.Designer.cs index 23ab6d93..d5767017 100644 --- a/src/Yavsc/Migrations/2017/20170106122307_Instruments.Designer.cs +++ b/src/Yavsc/Migrations/2017/20170106122307_Instruments.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2017/20170106122307_Instruments.cs b/src/Yavsc/Migrations/2017/20170106122307_Instruments.cs index 7d3a1d1f..62595bbd 100644 --- a/src/Yavsc/Migrations/2017/20170106122307_Instruments.cs +++ b/src/Yavsc/Migrations/2017/20170106122307_Instruments.cs @@ -1,5 +1,7 @@ -using Microsoft.Data.Entity.Migrations; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/2017/20170106124548_instrumentation.Designer.cs b/src/Yavsc/Migrations/2017/20170106124548_instrumentation.Designer.cs index f89c2350..f80659d3 100644 --- a/src/Yavsc/Migrations/2017/20170106124548_instrumentation.Designer.cs +++ b/src/Yavsc/Migrations/2017/20170106124548_instrumentation.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2017/20170106124548_instrumentation.cs b/src/Yavsc/Migrations/2017/20170106124548_instrumentation.cs index 927ed13f..b151dd29 100644 --- a/src/Yavsc/Migrations/2017/20170106124548_instrumentation.cs +++ b/src/Yavsc/Migrations/2017/20170106124548_instrumentation.cs @@ -1,5 +1,7 @@ -using Microsoft.Data.Entity.Migrations; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/2017/20170106144035_activityRate.Designer.cs b/src/Yavsc/Migrations/2017/20170106144035_activityRate.Designer.cs index 6e86ab10..0dbabaee 100644 --- a/src/Yavsc/Migrations/2017/20170106144035_activityRate.Designer.cs +++ b/src/Yavsc/Migrations/2017/20170106144035_activityRate.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2017/20170106144035_activityRate.cs b/src/Yavsc/Migrations/2017/20170106144035_activityRate.cs index 38375c8d..f078e139 100644 --- a/src/Yavsc/Migrations/2017/20170106144035_activityRate.cs +++ b/src/Yavsc/Migrations/2017/20170106144035_activityRate.cs @@ -1,5 +1,7 @@ -using Microsoft.Data.Entity.Migrations; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/2017/20170106235954_weight.Designer.cs b/src/Yavsc/Migrations/2017/20170106235954_weight.Designer.cs index 2ed9b98a..d3bda592 100644 --- a/src/Yavsc/Migrations/2017/20170106235954_weight.Designer.cs +++ b/src/Yavsc/Migrations/2017/20170106235954_weight.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2017/20170106235954_weight.cs b/src/Yavsc/Migrations/2017/20170106235954_weight.cs index 94a0c060..9f509d0b 100644 --- a/src/Yavsc/Migrations/2017/20170106235954_weight.cs +++ b/src/Yavsc/Migrations/2017/20170106235954_weight.cs @@ -1,5 +1,7 @@ -using Microsoft.Data.Entity.Migrations; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/2017/20170107004233_userActivitiesValidity.Designer.cs b/src/Yavsc/Migrations/2017/20170107004233_userActivitiesValidity.Designer.cs index dcccd66f..e31a730e 100644 --- a/src/Yavsc/Migrations/2017/20170107004233_userActivitiesValidity.Designer.cs +++ b/src/Yavsc/Migrations/2017/20170107004233_userActivitiesValidity.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2017/20170107004233_userActivitiesValidity.cs b/src/Yavsc/Migrations/2017/20170107004233_userActivitiesValidity.cs index c75f743a..307cb955 100644 --- a/src/Yavsc/Migrations/2017/20170107004233_userActivitiesValidity.cs +++ b/src/Yavsc/Migrations/2017/20170107004233_userActivitiesValidity.cs @@ -1,5 +1,7 @@ -using Microsoft.Data.Entity.Migrations; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/2017/20170113022807_SettingsClassName.Designer.cs b/src/Yavsc/Migrations/2017/20170113022807_SettingsClassName.Designer.cs index 9160d0f2..87faddee 100644 --- a/src/Yavsc/Migrations/2017/20170113022807_SettingsClassName.Designer.cs +++ b/src/Yavsc/Migrations/2017/20170113022807_SettingsClassName.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2017/20170113022807_SettingsClassName.cs b/src/Yavsc/Migrations/2017/20170113022807_SettingsClassName.cs index e0753b11..154695bd 100644 --- a/src/Yavsc/Migrations/2017/20170113022807_SettingsClassName.cs +++ b/src/Yavsc/Migrations/2017/20170113022807_SettingsClassName.cs @@ -1,5 +1,7 @@ -using Microsoft.Data.Entity.Migrations; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { public partial class SettingsClassName : Migration diff --git a/src/Yavsc/Migrations/2017/20170113150714_instrumentationReloaded.Designer.cs b/src/Yavsc/Migrations/2017/20170113150714_instrumentationReloaded.Designer.cs index 4e89b209..6ee3a311 100644 --- a/src/Yavsc/Migrations/2017/20170113150714_instrumentationReloaded.Designer.cs +++ b/src/Yavsc/Migrations/2017/20170113150714_instrumentationReloaded.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2017/20170113150714_instrumentationReloaded.cs b/src/Yavsc/Migrations/2017/20170113150714_instrumentationReloaded.cs index 28cd17ca..5b41324d 100644 --- a/src/Yavsc/Migrations/2017/20170113150714_instrumentationReloaded.cs +++ b/src/Yavsc/Migrations/2017/20170113150714_instrumentationReloaded.cs @@ -1,4 +1,7 @@ -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/2017/20170116002541_bookQueryActivityCode.Designer.cs b/src/Yavsc/Migrations/2017/20170116002541_bookQueryActivityCode.Designer.cs index ce9c7fdf..03eebcf4 100644 --- a/src/Yavsc/Migrations/2017/20170116002541_bookQueryActivityCode.Designer.cs +++ b/src/Yavsc/Migrations/2017/20170116002541_bookQueryActivityCode.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2017/20170116002541_bookQueryActivityCode.cs b/src/Yavsc/Migrations/2017/20170116002541_bookQueryActivityCode.cs index 08db76d4..24137989 100644 --- a/src/Yavsc/Migrations/2017/20170116002541_bookQueryActivityCode.cs +++ b/src/Yavsc/Migrations/2017/20170116002541_bookQueryActivityCode.cs @@ -1,4 +1,7 @@ -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/2017/20170116154735_refactPrproAllowGeo.Designer.cs b/src/Yavsc/Migrations/2017/20170116154735_refactPrproAllowGeo.Designer.cs index c245bc1e..5d1c46d0 100644 --- a/src/Yavsc/Migrations/2017/20170116154735_refactPrproAllowGeo.Designer.cs +++ b/src/Yavsc/Migrations/2017/20170116154735_refactPrproAllowGeo.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2017/20170116154735_refactPrproAllowGeo.cs b/src/Yavsc/Migrations/2017/20170116154735_refactPrproAllowGeo.cs index ae9990d5..beef9575 100644 --- a/src/Yavsc/Migrations/2017/20170116154735_refactPrproAllowGeo.cs +++ b/src/Yavsc/Migrations/2017/20170116154735_refactPrproAllowGeo.cs @@ -1,4 +1,7 @@ -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/2017/20170117134339_entityTracking.Designer.cs b/src/Yavsc/Migrations/2017/20170117134339_entityTracking.Designer.cs index 3edf4a60..2bca8612 100644 --- a/src/Yavsc/Migrations/2017/20170117134339_entityTracking.Designer.cs +++ b/src/Yavsc/Migrations/2017/20170117134339_entityTracking.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2017/20170117134339_entityTracking.cs b/src/Yavsc/Migrations/2017/20170117134339_entityTracking.cs index a62323d9..4cd132aa 100644 --- a/src/Yavsc/Migrations/2017/20170117134339_entityTracking.cs +++ b/src/Yavsc/Migrations/2017/20170117134339_entityTracking.cs @@ -1,6 +1,7 @@ -using System; -using Microsoft.Data.Entity.Migrations; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { public partial class entityTracking : Migration diff --git a/src/Yavsc/Migrations/2017/20170120095258_blogAcl.Designer.cs b/src/Yavsc/Migrations/2017/20170120095258_blogAcl.Designer.cs index b1a3f43b..643429f9 100644 --- a/src/Yavsc/Migrations/2017/20170120095258_blogAcl.Designer.cs +++ b/src/Yavsc/Migrations/2017/20170120095258_blogAcl.Designer.cs @@ -1,7 +1,8 @@ using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2017/20170120095258_blogAcl.cs b/src/Yavsc/Migrations/2017/20170120095258_blogAcl.cs index 6f9359d9..e9e34a03 100644 --- a/src/Yavsc/Migrations/2017/20170120095258_blogAcl.cs +++ b/src/Yavsc/Migrations/2017/20170120095258_blogAcl.cs @@ -1,4 +1,7 @@ -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/2017/20170120122324_queryTraking.Designer.cs b/src/Yavsc/Migrations/2017/20170120122324_queryTraking.Designer.cs index 20d0399d..ba1ac869 100644 --- a/src/Yavsc/Migrations/2017/20170120122324_queryTraking.Designer.cs +++ b/src/Yavsc/Migrations/2017/20170120122324_queryTraking.Designer.cs @@ -1,7 +1,8 @@ using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2017/20170120122324_queryTraking.cs b/src/Yavsc/Migrations/2017/20170120122324_queryTraking.cs index be2da30b..d24faf9c 100644 --- a/src/Yavsc/Migrations/2017/20170120122324_queryTraking.cs +++ b/src/Yavsc/Migrations/2017/20170120122324_queryTraking.cs @@ -1,5 +1,7 @@ -using System; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/2017/20170122160343_circlesMemberRefact.Designer.cs b/src/Yavsc/Migrations/2017/20170122160343_circlesMemberRefact.Designer.cs index ba71277c..ce94dfc7 100644 --- a/src/Yavsc/Migrations/2017/20170122160343_circlesMemberRefact.Designer.cs +++ b/src/Yavsc/Migrations/2017/20170122160343_circlesMemberRefact.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2017/20170122160343_circlesMemberRefact.cs b/src/Yavsc/Migrations/2017/20170122160343_circlesMemberRefact.cs index 2b553a6e..b85d4c8a 100644 --- a/src/Yavsc/Migrations/2017/20170122160343_circlesMemberRefact.cs +++ b/src/Yavsc/Migrations/2017/20170122160343_circlesMemberRefact.cs @@ -1,4 +1,7 @@ -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/2017/20170124090324_commandForms.Designer.cs b/src/Yavsc/Migrations/2017/20170124090324_commandForms.Designer.cs index 31f5e6da..ef529627 100644 --- a/src/Yavsc/Migrations/2017/20170124090324_commandForms.Designer.cs +++ b/src/Yavsc/Migrations/2017/20170124090324_commandForms.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2017/20170124090324_commandForms.cs b/src/Yavsc/Migrations/2017/20170124090324_commandForms.cs index f759198f..b9dd1856 100644 --- a/src/Yavsc/Migrations/2017/20170124090324_commandForms.cs +++ b/src/Yavsc/Migrations/2017/20170124090324_commandForms.cs @@ -1,5 +1,7 @@ -using Microsoft.Data.Entity.Migrations; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { public partial class commandForms : Migration diff --git a/src/Yavsc/Migrations/2017/20170126152454_trackActivity.Designer.cs b/src/Yavsc/Migrations/2017/20170126152454_trackActivity.Designer.cs index 94bfb8f6..308fdc8b 100644 --- a/src/Yavsc/Migrations/2017/20170126152454_trackActivity.Designer.cs +++ b/src/Yavsc/Migrations/2017/20170126152454_trackActivity.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2017/20170126152454_trackActivity.cs b/src/Yavsc/Migrations/2017/20170126152454_trackActivity.cs index dd112822..df04335a 100644 --- a/src/Yavsc/Migrations/2017/20170126152454_trackActivity.cs +++ b/src/Yavsc/Migrations/2017/20170126152454_trackActivity.cs @@ -1,5 +1,7 @@ -using System; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/2017/20170126152651_renameActViewNameToAction.Designer.cs b/src/Yavsc/Migrations/2017/20170126152651_renameActViewNameToAction.Designer.cs index 8b404583..e2927963 100644 --- a/src/Yavsc/Migrations/2017/20170126152651_renameActViewNameToAction.Designer.cs +++ b/src/Yavsc/Migrations/2017/20170126152651_renameActViewNameToAction.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2017/20170126152651_renameActViewNameToAction.cs b/src/Yavsc/Migrations/2017/20170126152651_renameActViewNameToAction.cs index e2af77ee..b11a3380 100644 --- a/src/Yavsc/Migrations/2017/20170126152651_renameActViewNameToAction.cs +++ b/src/Yavsc/Migrations/2017/20170126152651_renameActViewNameToAction.cs @@ -1,4 +1,7 @@ -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/2017/20170201002133_blacklisted.Designer.cs b/src/Yavsc/Migrations/2017/20170201002133_blacklisted.Designer.cs index 29679be9..8f69d34f 100644 --- a/src/Yavsc/Migrations/2017/20170201002133_blacklisted.Designer.cs +++ b/src/Yavsc/Migrations/2017/20170201002133_blacklisted.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2017/20170201002133_blacklisted.cs b/src/Yavsc/Migrations/2017/20170201002133_blacklisted.cs index 8f781ab8..245d86f0 100644 --- a/src/Yavsc/Migrations/2017/20170201002133_blacklisted.cs +++ b/src/Yavsc/Migrations/2017/20170201002133_blacklisted.cs @@ -1,5 +1,8 @@ using System; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/2017/20170201162847_defaultAvatar.Designer.cs b/src/Yavsc/Migrations/2017/20170201162847_defaultAvatar.Designer.cs index 7fa555f6..564accd0 100644 --- a/src/Yavsc/Migrations/2017/20170201162847_defaultAvatar.Designer.cs +++ b/src/Yavsc/Migrations/2017/20170201162847_defaultAvatar.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2017/20170201162847_defaultAvatar.cs b/src/Yavsc/Migrations/2017/20170201162847_defaultAvatar.cs index 2b2ed7cb..ceabbaa6 100644 --- a/src/Yavsc/Migrations/2017/20170201162847_defaultAvatar.cs +++ b/src/Yavsc/Migrations/2017/20170201162847_defaultAvatar.cs @@ -1,5 +1,7 @@ -using Microsoft.Data.Entity.Migrations; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/2017/20170202102936_defaultDiskQuota.Designer.cs b/src/Yavsc/Migrations/2017/20170202102936_defaultDiskQuota.Designer.cs index 4adb0b5e..e4332b91 100644 --- a/src/Yavsc/Migrations/2017/20170202102936_defaultDiskQuota.Designer.cs +++ b/src/Yavsc/Migrations/2017/20170202102936_defaultDiskQuota.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2017/20170202102936_defaultDiskQuota.cs b/src/Yavsc/Migrations/2017/20170202102936_defaultDiskQuota.cs index 8e1d2340..b6ea1a86 100644 --- a/src/Yavsc/Migrations/2017/20170202102936_defaultDiskQuota.cs +++ b/src/Yavsc/Migrations/2017/20170202102936_defaultDiskQuota.cs @@ -1,5 +1,7 @@ -using Microsoft.Data.Entity.Migrations; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { public partial class defaultDiskQuota : Migration diff --git a/src/Yavsc/Migrations/2017/20170212005346_haircut.Designer.cs b/src/Yavsc/Migrations/2017/20170212005346_haircut.Designer.cs index 24c996c0..16c1cfd0 100644 --- a/src/Yavsc/Migrations/2017/20170212005346_haircut.Designer.cs +++ b/src/Yavsc/Migrations/2017/20170212005346_haircut.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2017/20170212005346_haircut.cs b/src/Yavsc/Migrations/2017/20170212005346_haircut.cs index 05585cd6..3a1008e0 100644 --- a/src/Yavsc/Migrations/2017/20170212005346_haircut.cs +++ b/src/Yavsc/Migrations/2017/20170212005346_haircut.cs @@ -1,4 +1,7 @@ -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/2017/20170217221646_bookQueryStatus.Designer.cs b/src/Yavsc/Migrations/2017/20170217221646_bookQueryStatus.Designer.cs index 59e80846..de1f82b5 100644 --- a/src/Yavsc/Migrations/2017/20170217221646_bookQueryStatus.Designer.cs +++ b/src/Yavsc/Migrations/2017/20170217221646_bookQueryStatus.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2017/20170217221646_bookQueryStatus.cs b/src/Yavsc/Migrations/2017/20170217221646_bookQueryStatus.cs index 8fa3c649..17cf467e 100644 --- a/src/Yavsc/Migrations/2017/20170217221646_bookQueryStatus.cs +++ b/src/Yavsc/Migrations/2017/20170217221646_bookQueryStatus.cs @@ -1,4 +1,7 @@ -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/2017/20170220102125_notifications.Designer.cs b/src/Yavsc/Migrations/2017/20170220102125_notifications.Designer.cs index bbc61f0d..fcf7c588 100644 --- a/src/Yavsc/Migrations/2017/20170220102125_notifications.Designer.cs +++ b/src/Yavsc/Migrations/2017/20170220102125_notifications.Designer.cs @@ -1,7 +1,8 @@ using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2017/20170220102125_notifications.cs b/src/Yavsc/Migrations/2017/20170220102125_notifications.cs index 12bbbcd2..78c0166a 100644 --- a/src/Yavsc/Migrations/2017/20170220102125_notifications.cs +++ b/src/Yavsc/Migrations/2017/20170220102125_notifications.cs @@ -1,4 +1,7 @@ -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/2017/20170220125518_dimissclick.Designer.cs b/src/Yavsc/Migrations/2017/20170220125518_dimissclick.Designer.cs index 68dfef30..04fccaa5 100644 --- a/src/Yavsc/Migrations/2017/20170220125518_dimissclick.Designer.cs +++ b/src/Yavsc/Migrations/2017/20170220125518_dimissclick.Designer.cs @@ -1,7 +1,8 @@ using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2017/20170220125518_dimissclick.cs b/src/Yavsc/Migrations/2017/20170220125518_dimissclick.cs index 9bdc51ab..6b47b45b 100644 --- a/src/Yavsc/Migrations/2017/20170220125518_dimissclick.cs +++ b/src/Yavsc/Migrations/2017/20170220125518_dimissclick.cs @@ -1,4 +1,7 @@ -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/2017/20170220144141_hiddenActivity.Designer.cs b/src/Yavsc/Migrations/2017/20170220144141_hiddenActivity.Designer.cs index 2c4591f0..28d4656b 100644 --- a/src/Yavsc/Migrations/2017/20170220144141_hiddenActivity.Designer.cs +++ b/src/Yavsc/Migrations/2017/20170220144141_hiddenActivity.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2017/20170220144141_hiddenActivity.cs b/src/Yavsc/Migrations/2017/20170220144141_hiddenActivity.cs index 23647b1a..007e9abf 100644 --- a/src/Yavsc/Migrations/2017/20170220144141_hiddenActivity.cs +++ b/src/Yavsc/Migrations/2017/20170220144141_hiddenActivity.cs @@ -1,4 +1,7 @@ -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/2017/20170227151759_hairPrestations.Designer.cs b/src/Yavsc/Migrations/2017/20170227151759_hairPrestations.Designer.cs index 49167cc5..ea51e259 100644 --- a/src/Yavsc/Migrations/2017/20170227151759_hairPrestations.Designer.cs +++ b/src/Yavsc/Migrations/2017/20170227151759_hairPrestations.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2017/20170227151759_hairPrestations.cs b/src/Yavsc/Migrations/2017/20170227151759_hairPrestations.cs index 67928122..02886c42 100644 --- a/src/Yavsc/Migrations/2017/20170227151759_hairPrestations.cs +++ b/src/Yavsc/Migrations/2017/20170227151759_hairPrestations.cs @@ -1,5 +1,7 @@ -using System; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/2017/20170228115359_brusherProfile.Designer.cs b/src/Yavsc/Migrations/2017/20170228115359_brusherProfile.Designer.cs index 999f00b9..4108145a 100644 --- a/src/Yavsc/Migrations/2017/20170228115359_brusherProfile.Designer.cs +++ b/src/Yavsc/Migrations/2017/20170228115359_brusherProfile.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2017/20170228115359_brusherProfile.cs b/src/Yavsc/Migrations/2017/20170228115359_brusherProfile.cs index 868d9dda..1229669f 100644 --- a/src/Yavsc/Migrations/2017/20170228115359_brusherProfile.cs +++ b/src/Yavsc/Migrations/2017/20170228115359_brusherProfile.cs @@ -1,4 +1,7 @@ -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/2017/20170228145057_actionName.Designer.cs b/src/Yavsc/Migrations/2017/20170228145057_actionName.Designer.cs index 2f0deab1..50e54d88 100644 --- a/src/Yavsc/Migrations/2017/20170228145057_actionName.Designer.cs +++ b/src/Yavsc/Migrations/2017/20170228145057_actionName.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2017/20170228145057_actionName.cs b/src/Yavsc/Migrations/2017/20170228145057_actionName.cs index 6ce1b32c..3a8cab8f 100644 --- a/src/Yavsc/Migrations/2017/20170228145057_actionName.cs +++ b/src/Yavsc/Migrations/2017/20170228145057_actionName.cs @@ -1,4 +1,7 @@ -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/2017/20170301124608_brusherActiondistance.Designer.cs b/src/Yavsc/Migrations/2017/20170301124608_brusherActiondistance.Designer.cs index b82c2e5a..bb4ef351 100644 --- a/src/Yavsc/Migrations/2017/20170301124608_brusherActiondistance.Designer.cs +++ b/src/Yavsc/Migrations/2017/20170301124608_brusherActiondistance.Designer.cs @@ -1,7 +1,8 @@ using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2017/20170301124608_brusherActiondistance.cs b/src/Yavsc/Migrations/2017/20170301124608_brusherActiondistance.cs index 8d634876..5b2d0191 100644 --- a/src/Yavsc/Migrations/2017/20170301124608_brusherActiondistance.cs +++ b/src/Yavsc/Migrations/2017/20170301124608_brusherActiondistance.cs @@ -1,4 +1,7 @@ -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/2017/20170301132531_manbrushing.Designer.cs b/src/Yavsc/Migrations/2017/20170301132531_manbrushing.Designer.cs index b6b42261..2c7b1b20 100644 --- a/src/Yavsc/Migrations/2017/20170301132531_manbrushing.Designer.cs +++ b/src/Yavsc/Migrations/2017/20170301132531_manbrushing.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2017/20170301132531_manbrushing.cs b/src/Yavsc/Migrations/2017/20170301132531_manbrushing.cs index 0573ad22..aba7fd56 100644 --- a/src/Yavsc/Migrations/2017/20170301132531_manbrushing.cs +++ b/src/Yavsc/Migrations/2017/20170301132531_manbrushing.cs @@ -1,5 +1,7 @@ -using Microsoft.Data.Entity.Migrations; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { public partial class manbrushing : Migration diff --git a/src/Yavsc/Migrations/2017/20170301211317_folding.Designer.cs b/src/Yavsc/Migrations/2017/20170301211317_folding.Designer.cs index df8daba4..f859e684 100644 --- a/src/Yavsc/Migrations/2017/20170301211317_folding.Designer.cs +++ b/src/Yavsc/Migrations/2017/20170301211317_folding.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2017/20170301211317_folding.cs b/src/Yavsc/Migrations/2017/20170301211317_folding.cs index 90bb3d09..41b836f2 100644 --- a/src/Yavsc/Migrations/2017/20170301211317_folding.cs +++ b/src/Yavsc/Migrations/2017/20170301211317_folding.cs @@ -1,4 +1,7 @@ -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/2017/20170302122929_brusherProfileDiscount.Designer.cs b/src/Yavsc/Migrations/2017/20170302122929_brusherProfileDiscount.Designer.cs index 4e050e69..0d27aae3 100644 --- a/src/Yavsc/Migrations/2017/20170302122929_brusherProfileDiscount.Designer.cs +++ b/src/Yavsc/Migrations/2017/20170302122929_brusherProfileDiscount.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2017/20170302122929_brusherProfileDiscount.cs b/src/Yavsc/Migrations/2017/20170302122929_brusherProfileDiscount.cs index 56d7aada..713c2d85 100644 --- a/src/Yavsc/Migrations/2017/20170302122929_brusherProfileDiscount.cs +++ b/src/Yavsc/Migrations/2017/20170302122929_brusherProfileDiscount.cs @@ -1,4 +1,7 @@ -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/2017/20170303000800_estimateRequireCommandType.Designer.cs b/src/Yavsc/Migrations/2017/20170303000800_estimateRequireCommandType.Designer.cs index 78fd8229..31c638a5 100644 --- a/src/Yavsc/Migrations/2017/20170303000800_estimateRequireCommandType.Designer.cs +++ b/src/Yavsc/Migrations/2017/20170303000800_estimateRequireCommandType.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2017/20170303000800_estimateRequireCommandType.cs b/src/Yavsc/Migrations/2017/20170303000800_estimateRequireCommandType.cs index 2ffead0b..b6e6f786 100644 --- a/src/Yavsc/Migrations/2017/20170303000800_estimateRequireCommandType.cs +++ b/src/Yavsc/Migrations/2017/20170303000800_estimateRequireCommandType.cs @@ -1,4 +1,7 @@ -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/2017/20170317213255_cxRequiresUserName.Designer.cs b/src/Yavsc/Migrations/2017/20170317213255_cxRequiresUserName.Designer.cs index 6e275e81..60cea978 100644 --- a/src/Yavsc/Migrations/2017/20170317213255_cxRequiresUserName.Designer.cs +++ b/src/Yavsc/Migrations/2017/20170317213255_cxRequiresUserName.Designer.cs @@ -1,7 +1,8 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2017/20170317213255_cxRequiresUserName.cs b/src/Yavsc/Migrations/2017/20170317213255_cxRequiresUserName.cs index 0697a68a..80fc1866 100644 --- a/src/Yavsc/Migrations/2017/20170317213255_cxRequiresUserName.cs +++ b/src/Yavsc/Migrations/2017/20170317213255_cxRequiresUserName.cs @@ -1,5 +1,7 @@ -using Microsoft.Data.Entity.Migrations; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { public partial class cxRequiresUserName : Migration diff --git a/src/Yavsc/Migrations/2017/20170329075249_avatarMayBeNull.Designer.cs b/src/Yavsc/Migrations/2017/20170329075249_avatarMayBeNull.Designer.cs index 84ca3f60..d44f91f2 100644 --- a/src/Yavsc/Migrations/2017/20170329075249_avatarMayBeNull.Designer.cs +++ b/src/Yavsc/Migrations/2017/20170329075249_avatarMayBeNull.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2017/20170329075249_avatarMayBeNull.cs b/src/Yavsc/Migrations/2017/20170329075249_avatarMayBeNull.cs index 7d00ee4f..c2941d32 100644 --- a/src/Yavsc/Migrations/2017/20170329075249_avatarMayBeNull.cs +++ b/src/Yavsc/Migrations/2017/20170329075249_avatarMayBeNull.cs @@ -1,4 +1,7 @@ -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/2017/20170331214327_rdvqueryAndNoLocationNorDate.Designer.cs b/src/Yavsc/Migrations/2017/20170331214327_rdvqueryAndNoLocationNorDate.Designer.cs index 9f6e963e..9c2ac13f 100644 --- a/src/Yavsc/Migrations/2017/20170331214327_rdvqueryAndNoLocationNorDate.Designer.cs +++ b/src/Yavsc/Migrations/2017/20170331214327_rdvqueryAndNoLocationNorDate.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2017/20170331214327_rdvqueryAndNoLocationNorDate.cs b/src/Yavsc/Migrations/2017/20170331214327_rdvqueryAndNoLocationNorDate.cs index db0cb9ea..323a633d 100644 --- a/src/Yavsc/Migrations/2017/20170331214327_rdvqueryAndNoLocationNorDate.cs +++ b/src/Yavsc/Migrations/2017/20170331214327_rdvqueryAndNoLocationNorDate.cs @@ -1,5 +1,7 @@ -using System; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/2017/20170408055642_haircutqueryAdditionalInfo.Designer.cs b/src/Yavsc/Migrations/2017/20170408055642_haircutqueryAdditionalInfo.Designer.cs index 7038ed37..2bb9fb77 100644 --- a/src/Yavsc/Migrations/2017/20170408055642_haircutqueryAdditionalInfo.Designer.cs +++ b/src/Yavsc/Migrations/2017/20170408055642_haircutqueryAdditionalInfo.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2017/20170408055642_haircutqueryAdditionalInfo.cs b/src/Yavsc/Migrations/2017/20170408055642_haircutqueryAdditionalInfo.cs index e3bc690e..888467c1 100644 --- a/src/Yavsc/Migrations/2017/20170408055642_haircutqueryAdditionalInfo.cs +++ b/src/Yavsc/Migrations/2017/20170408055642_haircutqueryAdditionalInfo.cs @@ -1,5 +1,8 @@ -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/2017/20170409004555_haircutCommandTaints.Designer.cs b/src/Yavsc/Migrations/2017/20170409004555_haircutCommandTaints.Designer.cs index 5f6078ff..dc357135 100644 --- a/src/Yavsc/Migrations/2017/20170409004555_haircutCommandTaints.Designer.cs +++ b/src/Yavsc/Migrations/2017/20170409004555_haircutCommandTaints.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2017/20170409004555_haircutCommandTaints.cs b/src/Yavsc/Migrations/2017/20170409004555_haircutCommandTaints.cs index 84ff22a5..9bd6e51d 100644 --- a/src/Yavsc/Migrations/2017/20170409004555_haircutCommandTaints.cs +++ b/src/Yavsc/Migrations/2017/20170409004555_haircutCommandTaints.cs @@ -1,5 +1,8 @@ -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/2017/20170507200834_paypal.Designer.cs b/src/Yavsc/Migrations/2017/20170507200834_paypal.Designer.cs index 635e25ac..8fb01fb5 100644 --- a/src/Yavsc/Migrations/2017/20170507200834_paypal.Designer.cs +++ b/src/Yavsc/Migrations/2017/20170507200834_paypal.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2017/20170507200834_paypal.cs b/src/Yavsc/Migrations/2017/20170507200834_paypal.cs index 1e9f35cd..0b7234c1 100644 --- a/src/Yavsc/Migrations/2017/20170507200834_paypal.cs +++ b/src/Yavsc/Migrations/2017/20170507200834_paypal.cs @@ -1,5 +1,7 @@ -using System; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/2017/20170510121057_hairCutPaypalPayment.Designer.cs b/src/Yavsc/Migrations/2017/20170510121057_hairCutPaypalPayment.Designer.cs index 021e544b..9bb349a6 100644 --- a/src/Yavsc/Migrations/2017/20170510121057_hairCutPaypalPayment.Designer.cs +++ b/src/Yavsc/Migrations/2017/20170510121057_hairCutPaypalPayment.Designer.cs @@ -1,7 +1,8 @@ using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2017/20170510121057_hairCutPaypalPayment.cs b/src/Yavsc/Migrations/2017/20170510121057_hairCutPaypalPayment.cs index 5fc69278..a31650a7 100644 --- a/src/Yavsc/Migrations/2017/20170510121057_hairCutPaypalPayment.cs +++ b/src/Yavsc/Migrations/2017/20170510121057_hairCutPaypalPayment.cs @@ -1,5 +1,7 @@ -using Microsoft.Data.Entity.Migrations; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { public partial class hairCutPaypalPayment : Migration diff --git a/src/Yavsc/Migrations/2017/20170512102508_hairCutBill.Designer.cs b/src/Yavsc/Migrations/2017/20170512102508_hairCutBill.Designer.cs index 89d95a08..85dc9cad 100644 --- a/src/Yavsc/Migrations/2017/20170512102508_hairCutBill.Designer.cs +++ b/src/Yavsc/Migrations/2017/20170512102508_hairCutBill.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2017/20170512102508_hairCutBill.cs b/src/Yavsc/Migrations/2017/20170512102508_hairCutBill.cs index b6c2bb8a..50c7d563 100644 --- a/src/Yavsc/Migrations/2017/20170512102508_hairCutBill.cs +++ b/src/Yavsc/Migrations/2017/20170512102508_hairCutBill.cs @@ -1,5 +1,7 @@ -using Microsoft.Data.Entity.Migrations; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { public partial class hairCutBill : Migration diff --git a/src/Yavsc/Migrations/2017/20170513213829_paypalids.Designer.cs b/src/Yavsc/Migrations/2017/20170513213829_paypalids.Designer.cs index 6e9faa2d..badcfc59 100644 --- a/src/Yavsc/Migrations/2017/20170513213829_paypalids.Designer.cs +++ b/src/Yavsc/Migrations/2017/20170513213829_paypalids.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2017/20170513213829_paypalids.cs b/src/Yavsc/Migrations/2017/20170513213829_paypalids.cs index 345fc262..30fd4b9a 100644 --- a/src/Yavsc/Migrations/2017/20170513213829_paypalids.cs +++ b/src/Yavsc/Migrations/2017/20170513213829_paypalids.cs @@ -1,4 +1,7 @@ -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/2017/20170514123122_links.Designer.cs b/src/Yavsc/Migrations/2017/20170514123122_links.Designer.cs index 4ad85504..22bc08f6 100644 --- a/src/Yavsc/Migrations/2017/20170514123122_links.Designer.cs +++ b/src/Yavsc/Migrations/2017/20170514123122_links.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2017/20170514123122_links.cs b/src/Yavsc/Migrations/2017/20170514123122_links.cs index a896e1c0..5668841d 100644 --- a/src/Yavsc/Migrations/2017/20170514123122_links.cs +++ b/src/Yavsc/Migrations/2017/20170514123122_links.cs @@ -1,5 +1,7 @@ -using Microsoft.Data.Entity.Migrations; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { public partial class links : Migration diff --git a/src/Yavsc/Migrations/2017/20170516181745_paymentConsent.Designer.cs b/src/Yavsc/Migrations/2017/20170516181745_paymentConsent.Designer.cs index 521f146b..8442d9d0 100644 --- a/src/Yavsc/Migrations/2017/20170516181745_paymentConsent.Designer.cs +++ b/src/Yavsc/Migrations/2017/20170516181745_paymentConsent.Designer.cs @@ -1,7 +1,7 @@ using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2017/20170516181745_paymentConsent.cs b/src/Yavsc/Migrations/2017/20170516181745_paymentConsent.cs index 6087c1cb..f2b235e5 100644 --- a/src/Yavsc/Migrations/2017/20170516181745_paymentConsent.cs +++ b/src/Yavsc/Migrations/2017/20170516181745_paymentConsent.cs @@ -1,5 +1,8 @@ -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/2017/20170517001340_notificatioinTarget.Designer.cs b/src/Yavsc/Migrations/2017/20170517001340_notificatioinTarget.Designer.cs index 217515d5..5e387fcc 100644 --- a/src/Yavsc/Migrations/2017/20170517001340_notificatioinTarget.Designer.cs +++ b/src/Yavsc/Migrations/2017/20170517001340_notificatioinTarget.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2017/20170517001340_notificatioinTarget.cs b/src/Yavsc/Migrations/2017/20170517001340_notificatioinTarget.cs index 00a64dc1..cad07b3c 100644 --- a/src/Yavsc/Migrations/2017/20170517001340_notificatioinTarget.cs +++ b/src/Yavsc/Migrations/2017/20170517001340_notificatioinTarget.cs @@ -1,4 +1,7 @@ -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/2017/20170524210924_paypalToDeprecated.Designer.cs b/src/Yavsc/Migrations/2017/20170524210924_paypalToDeprecated.Designer.cs index 5509cd47..05fa66c3 100644 --- a/src/Yavsc/Migrations/2017/20170524210924_paypalToDeprecated.Designer.cs +++ b/src/Yavsc/Migrations/2017/20170524210924_paypalToDeprecated.Designer.cs @@ -1,7 +1,8 @@ using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2017/20170524210924_paypalToDeprecated.cs b/src/Yavsc/Migrations/2017/20170524210924_paypalToDeprecated.cs index dc882fda..1818ea61 100644 --- a/src/Yavsc/Migrations/2017/20170524210924_paypalToDeprecated.cs +++ b/src/Yavsc/Migrations/2017/20170524210924_paypalToDeprecated.cs @@ -1,4 +1,7 @@ -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/2017/20170526020220_rdvPayment.Designer.cs b/src/Yavsc/Migrations/2017/20170526020220_rdvPayment.Designer.cs index 612305ae..1719abe6 100644 --- a/src/Yavsc/Migrations/2017/20170526020220_rdvPayment.Designer.cs +++ b/src/Yavsc/Migrations/2017/20170526020220_rdvPayment.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2017/20170526020220_rdvPayment.cs b/src/Yavsc/Migrations/2017/20170526020220_rdvPayment.cs index 1806a661..94a03f2b 100644 --- a/src/Yavsc/Migrations/2017/20170526020220_rdvPayment.cs +++ b/src/Yavsc/Migrations/2017/20170526020220_rdvPayment.cs @@ -1,5 +1,7 @@ -using Microsoft.Data.Entity.Migrations; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { public partial class rdvPayment : Migration diff --git a/src/Yavsc/Migrations/2017/20170601115553_period.Designer.cs b/src/Yavsc/Migrations/2017/20170601115553_period.Designer.cs index 5f944739..6d16f0c2 100644 --- a/src/Yavsc/Migrations/2017/20170601115553_period.Designer.cs +++ b/src/Yavsc/Migrations/2017/20170601115553_period.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2017/20170601115553_period.cs b/src/Yavsc/Migrations/2017/20170601115553_period.cs index 62edc3c9..1f90af23 100644 --- a/src/Yavsc/Migrations/2017/20170601115553_period.cs +++ b/src/Yavsc/Migrations/2017/20170601115553_period.cs @@ -1,5 +1,7 @@ -using System; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/2017/20170611141231_BrusherCalendarModel.Designer.cs b/src/Yavsc/Migrations/2017/20170611141231_BrusherCalendarModel.Designer.cs index 095729a6..0650db95 100644 --- a/src/Yavsc/Migrations/2017/20170611141231_BrusherCalendarModel.Designer.cs +++ b/src/Yavsc/Migrations/2017/20170611141231_BrusherCalendarModel.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2017/20170611141231_BrusherCalendarModel.cs b/src/Yavsc/Migrations/2017/20170611141231_BrusherCalendarModel.cs index b0ab99d6..5e7ab56c 100644 --- a/src/Yavsc/Migrations/2017/20170611141231_BrusherCalendarModel.cs +++ b/src/Yavsc/Migrations/2017/20170611141231_BrusherCalendarModel.cs @@ -1,5 +1,7 @@ -using System; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/2017/20171002023107_Features.Designer.cs b/src/Yavsc/Migrations/2017/20171002023107_Features.Designer.cs index 8055a6cd..b6a8cc03 100644 --- a/src/Yavsc/Migrations/2017/20171002023107_Features.Designer.cs +++ b/src/Yavsc/Migrations/2017/20171002023107_Features.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2017/20171002023107_Features.cs b/src/Yavsc/Migrations/2017/20171002023107_Features.cs index 02338b09..6d027454 100644 --- a/src/Yavsc/Migrations/2017/20171002023107_Features.cs +++ b/src/Yavsc/Migrations/2017/20171002023107_Features.cs @@ -1,5 +1,7 @@ -using System; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/2017/20171002023835_bugs.Designer.cs b/src/Yavsc/Migrations/2017/20171002023835_bugs.Designer.cs index 98d96d65..4e908661 100644 --- a/src/Yavsc/Migrations/2017/20171002023835_bugs.Designer.cs +++ b/src/Yavsc/Migrations/2017/20171002023835_bugs.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2017/20171002023835_bugs.cs b/src/Yavsc/Migrations/2017/20171002023835_bugs.cs index 89344282..06f07d26 100644 --- a/src/Yavsc/Migrations/2017/20171002023835_bugs.cs +++ b/src/Yavsc/Migrations/2017/20171002023835_bugs.cs @@ -1,4 +1,7 @@ -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/2017/20171003195221_BlogRename.Designer.cs b/src/Yavsc/Migrations/2017/20171003195221_BlogRename.Designer.cs index 3c5b0b83..0da98f2c 100644 --- a/src/Yavsc/Migrations/2017/20171003195221_BlogRename.Designer.cs +++ b/src/Yavsc/Migrations/2017/20171003195221_BlogRename.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2017/20171003195221_BlogRename.cs b/src/Yavsc/Migrations/2017/20171003195221_BlogRename.cs index 88b46200..3dcd48d0 100644 --- a/src/Yavsc/Migrations/2017/20171003195221_BlogRename.cs +++ b/src/Yavsc/Migrations/2017/20171003195221_BlogRename.cs @@ -1,5 +1,7 @@ -using Microsoft.Data.Entity.Migrations; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { public partial class BlogRename : Migration diff --git a/src/Yavsc/Migrations/2017/20171003203721_BlogComment.Designer.cs b/src/Yavsc/Migrations/2017/20171003203721_BlogComment.Designer.cs index d7372de5..81fc9df2 100644 --- a/src/Yavsc/Migrations/2017/20171003203721_BlogComment.Designer.cs +++ b/src/Yavsc/Migrations/2017/20171003203721_BlogComment.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2017/20171003203721_BlogComment.cs b/src/Yavsc/Migrations/2017/20171003203721_BlogComment.cs index 70ae3725..8adcf8f3 100644 --- a/src/Yavsc/Migrations/2017/20171003203721_BlogComment.cs +++ b/src/Yavsc/Migrations/2017/20171003203721_BlogComment.cs @@ -1,6 +1,7 @@ -using System; -using Microsoft.Data.Entity.Migrations; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { public partial class BlogComment : Migration diff --git a/src/Yavsc/Migrations/2017/20171008184908_annouce.Designer.cs b/src/Yavsc/Migrations/2017/20171008184908_annouce.Designer.cs index 81ee3f36..94d444f8 100644 --- a/src/Yavsc/Migrations/2017/20171008184908_annouce.Designer.cs +++ b/src/Yavsc/Migrations/2017/20171008184908_annouce.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2017/20171008184908_annouce.cs b/src/Yavsc/Migrations/2017/20171008184908_annouce.cs index be018866..8e757460 100644 --- a/src/Yavsc/Migrations/2017/20171008184908_annouce.cs +++ b/src/Yavsc/Migrations/2017/20171008184908_annouce.cs @@ -1,4 +1,7 @@ -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/2017/20171008190234_announceAnwer.Designer.cs b/src/Yavsc/Migrations/2017/20171008190234_announceAnwer.Designer.cs index c6f6e650..f0081eba 100644 --- a/src/Yavsc/Migrations/2017/20171008190234_announceAnwer.Designer.cs +++ b/src/Yavsc/Migrations/2017/20171008190234_announceAnwer.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2017/20171008190234_announceAnwer.cs b/src/Yavsc/Migrations/2017/20171008190234_announceAnwer.cs index 7935c03b..5f6b8806 100644 --- a/src/Yavsc/Migrations/2017/20171008190234_announceAnwer.cs +++ b/src/Yavsc/Migrations/2017/20171008190234_announceAnwer.cs @@ -1,4 +1,7 @@ -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/2017/20171016090837_bugDescription.Designer.cs b/src/Yavsc/Migrations/2017/20171016090837_bugDescription.Designer.cs index 64553276..d9165562 100644 --- a/src/Yavsc/Migrations/2017/20171016090837_bugDescription.Designer.cs +++ b/src/Yavsc/Migrations/2017/20171016090837_bugDescription.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2017/20171016090837_bugDescription.cs b/src/Yavsc/Migrations/2017/20171016090837_bugDescription.cs index 8596c7c5..ab3c2c10 100644 --- a/src/Yavsc/Migrations/2017/20171016090837_bugDescription.cs +++ b/src/Yavsc/Migrations/2017/20171016090837_bugDescription.cs @@ -1,4 +1,7 @@ -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/2017/20171019130120_subComment.Designer.cs b/src/Yavsc/Migrations/2017/20171019130120_subComment.Designer.cs index c0ec8daa..c33504ae 100644 --- a/src/Yavsc/Migrations/2017/20171019130120_subComment.Designer.cs +++ b/src/Yavsc/Migrations/2017/20171019130120_subComment.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2017/20171019130120_subComment.cs b/src/Yavsc/Migrations/2017/20171019130120_subComment.cs index 2169cef2..1d424d0a 100644 --- a/src/Yavsc/Migrations/2017/20171019130120_subComment.cs +++ b/src/Yavsc/Migrations/2017/20171019130120_subComment.cs @@ -1,5 +1,7 @@ -using Microsoft.Data.Entity.Migrations; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { public partial class subComment : Migration diff --git a/src/Yavsc/Migrations/2017/20171020090944_commentAuthor.Designer.cs b/src/Yavsc/Migrations/2017/20171020090944_commentAuthor.Designer.cs index 5afd9230..8c03389f 100644 --- a/src/Yavsc/Migrations/2017/20171020090944_commentAuthor.Designer.cs +++ b/src/Yavsc/Migrations/2017/20171020090944_commentAuthor.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2017/20171020090944_commentAuthor.cs b/src/Yavsc/Migrations/2017/20171020090944_commentAuthor.cs index 2121848d..2ee656ee 100644 --- a/src/Yavsc/Migrations/2017/20171020090944_commentAuthor.cs +++ b/src/Yavsc/Migrations/2017/20171020090944_commentAuthor.cs @@ -1,4 +1,7 @@ -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/2017/20171020173835_commentAuthorId.Designer.cs b/src/Yavsc/Migrations/2017/20171020173835_commentAuthorId.Designer.cs index 7e1fda6e..887f5b3f 100644 --- a/src/Yavsc/Migrations/2017/20171020173835_commentAuthorId.Designer.cs +++ b/src/Yavsc/Migrations/2017/20171020173835_commentAuthorId.Designer.cs @@ -1,7 +1,8 @@ using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2017/20171020173835_commentAuthorId.cs b/src/Yavsc/Migrations/2017/20171020173835_commentAuthorId.cs index 0ce1a33d..cced9121 100644 --- a/src/Yavsc/Migrations/2017/20171020173835_commentAuthorId.cs +++ b/src/Yavsc/Migrations/2017/20171020173835_commentAuthorId.cs @@ -1,4 +1,7 @@ -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/2018/20180102153009_chatRooms.Designer.cs b/src/Yavsc/Migrations/2018/20180102153009_chatRooms.Designer.cs index a6163caa..6810d5bb 100644 --- a/src/Yavsc/Migrations/2018/20180102153009_chatRooms.Designer.cs +++ b/src/Yavsc/Migrations/2018/20180102153009_chatRooms.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2018/20180102153009_chatRooms.cs b/src/Yavsc/Migrations/2018/20180102153009_chatRooms.cs index c23fac19..00811b46 100644 --- a/src/Yavsc/Migrations/2018/20180102153009_chatRooms.cs +++ b/src/Yavsc/Migrations/2018/20180102153009_chatRooms.cs @@ -1,4 +1,7 @@ -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/2018/20180209144114_rejectQuery.Designer.cs b/src/Yavsc/Migrations/2018/20180209144114_rejectQuery.Designer.cs index 5bb446e8..9181dfe4 100644 --- a/src/Yavsc/Migrations/2018/20180209144114_rejectQuery.Designer.cs +++ b/src/Yavsc/Migrations/2018/20180209144114_rejectQuery.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2018/20180209144114_rejectQuery.cs b/src/Yavsc/Migrations/2018/20180209144114_rejectQuery.cs index 314d2bf3..3df81cae 100644 --- a/src/Yavsc/Migrations/2018/20180209144114_rejectQuery.cs +++ b/src/Yavsc/Migrations/2018/20180209144114_rejectQuery.cs @@ -1,5 +1,7 @@ -using System; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/2018/20180420213912_mailingTemplates.Designer.cs b/src/Yavsc/Migrations/2018/20180420213912_mailingTemplates.Designer.cs index 8ed43de1..662e2e54 100644 --- a/src/Yavsc/Migrations/2018/20180420213912_mailingTemplates.Designer.cs +++ b/src/Yavsc/Migrations/2018/20180420213912_mailingTemplates.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2018/20180420213912_mailingTemplates.cs b/src/Yavsc/Migrations/2018/20180420213912_mailingTemplates.cs index e265aa3e..b6c009ee 100644 --- a/src/Yavsc/Migrations/2018/20180420213912_mailingTemplates.cs +++ b/src/Yavsc/Migrations/2018/20180420213912_mailingTemplates.cs @@ -1,6 +1,7 @@ -using System; -using Microsoft.Data.Entity.Migrations; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { public partial class mailingTemplates : Migration diff --git a/src/Yavsc/Migrations/2018/20180503100246_userAllowMonthlyEmail.Designer.cs b/src/Yavsc/Migrations/2018/20180503100246_userAllowMonthlyEmail.Designer.cs index f944d535..c8805001 100644 --- a/src/Yavsc/Migrations/2018/20180503100246_userAllowMonthlyEmail.Designer.cs +++ b/src/Yavsc/Migrations/2018/20180503100246_userAllowMonthlyEmail.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2018/20180503100246_userAllowMonthlyEmail.cs b/src/Yavsc/Migrations/2018/20180503100246_userAllowMonthlyEmail.cs index 09b30b07..9b9bca91 100644 --- a/src/Yavsc/Migrations/2018/20180503100246_userAllowMonthlyEmail.cs +++ b/src/Yavsc/Migrations/2018/20180503100246_userAllowMonthlyEmail.cs @@ -1,5 +1,7 @@ -using System; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/2018/20180625113528_Git.Designer.cs b/src/Yavsc/Migrations/2018/20180625113528_Git.Designer.cs index 41c157ac..bc62e604 100644 --- a/src/Yavsc/Migrations/2018/20180625113528_Git.Designer.cs +++ b/src/Yavsc/Migrations/2018/20180625113528_Git.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2018/20180625113528_Git.cs b/src/Yavsc/Migrations/2018/20180625113528_Git.cs index 1e650e03..bbfc7c13 100644 --- a/src/Yavsc/Migrations/2018/20180625113528_Git.cs +++ b/src/Yavsc/Migrations/2018/20180625113528_Git.cs @@ -1,5 +1,7 @@ -using System; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/2018/20180703224638_wrongProjectConfigForeignKey.Designer.cs b/src/Yavsc/Migrations/2018/20180703224638_wrongProjectConfigForeignKey.Designer.cs index 60d79df9..4bbf55e2 100644 --- a/src/Yavsc/Migrations/2018/20180703224638_wrongProjectConfigForeignKey.Designer.cs +++ b/src/Yavsc/Migrations/2018/20180703224638_wrongProjectConfigForeignKey.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2018/20180703224638_wrongProjectConfigForeignKey.cs b/src/Yavsc/Migrations/2018/20180703224638_wrongProjectConfigForeignKey.cs index 5e439226..3bd78230 100644 --- a/src/Yavsc/Migrations/2018/20180703224638_wrongProjectConfigForeignKey.cs +++ b/src/Yavsc/Migrations/2018/20180703224638_wrongProjectConfigForeignKey.cs @@ -1,4 +1,7 @@ -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/2018/20180703231814_wrongProjectConfigForeignKeyBis.Designer.cs b/src/Yavsc/Migrations/2018/20180703231814_wrongProjectConfigForeignKeyBis.Designer.cs index d883b6ad..136dad51 100644 --- a/src/Yavsc/Migrations/2018/20180703231814_wrongProjectConfigForeignKeyBis.Designer.cs +++ b/src/Yavsc/Migrations/2018/20180703231814_wrongProjectConfigForeignKeyBis.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2018/20180703231814_wrongProjectConfigForeignKeyBis.cs b/src/Yavsc/Migrations/2018/20180703231814_wrongProjectConfigForeignKeyBis.cs index 2dc13853..c63a2d54 100644 --- a/src/Yavsc/Migrations/2018/20180703231814_wrongProjectConfigForeignKeyBis.cs +++ b/src/Yavsc/Migrations/2018/20180703231814_wrongProjectConfigForeignKeyBis.cs @@ -1,4 +1,7 @@ -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/2018/20180805122812_gitprojectref.Designer.cs b/src/Yavsc/Migrations/2018/20180805122812_gitprojectref.Designer.cs index e6c28833..2905014a 100644 --- a/src/Yavsc/Migrations/2018/20180805122812_gitprojectref.Designer.cs +++ b/src/Yavsc/Migrations/2018/20180805122812_gitprojectref.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2018/20180805122812_gitprojectref.cs b/src/Yavsc/Migrations/2018/20180805122812_gitprojectref.cs index 43f9aaaa..0765909b 100644 --- a/src/Yavsc/Migrations/2018/20180805122812_gitprojectref.cs +++ b/src/Yavsc/Migrations/2018/20180805122812_gitprojectref.cs @@ -1,4 +1,7 @@ -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/2018/20181212103501_blogLang.Designer.cs b/src/Yavsc/Migrations/2018/20181212103501_blogLang.Designer.cs index 351620b9..8e90d6db 100644 --- a/src/Yavsc/Migrations/2018/20181212103501_blogLang.Designer.cs +++ b/src/Yavsc/Migrations/2018/20181212103501_blogLang.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2018/20181212103501_blogLang.cs b/src/Yavsc/Migrations/2018/20181212103501_blogLang.cs index 23df91b2..768d3c65 100644 --- a/src/Yavsc/Migrations/2018/20181212103501_blogLang.cs +++ b/src/Yavsc/Migrations/2018/20181212103501_blogLang.cs @@ -1,4 +1,7 @@ -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/2018/20181218152420_BlogTradModel.Designer.cs b/src/Yavsc/Migrations/2018/20181218152420_BlogTradModel.Designer.cs index 077a74f1..56663856 100644 --- a/src/Yavsc/Migrations/2018/20181218152420_BlogTradModel.Designer.cs +++ b/src/Yavsc/Migrations/2018/20181218152420_BlogTradModel.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2018/20181218152420_BlogTradModel.cs b/src/Yavsc/Migrations/2018/20181218152420_BlogTradModel.cs index 04681841..61f6a809 100644 --- a/src/Yavsc/Migrations/2018/20181218152420_BlogTradModel.cs +++ b/src/Yavsc/Migrations/2018/20181218152420_BlogTradModel.cs @@ -1,4 +1,7 @@ -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/2018/20181231153224_bugTitles.Designer.cs b/src/Yavsc/Migrations/2018/20181231153224_bugTitles.Designer.cs index 5b47f715..1bc62c04 100644 --- a/src/Yavsc/Migrations/2018/20181231153224_bugTitles.Designer.cs +++ b/src/Yavsc/Migrations/2018/20181231153224_bugTitles.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2018/20181231153224_bugTitles.cs b/src/Yavsc/Migrations/2018/20181231153224_bugTitles.cs index 5d4a0085..1acde92d 100644 --- a/src/Yavsc/Migrations/2018/20181231153224_bugTitles.cs +++ b/src/Yavsc/Migrations/2018/20181231153224_bugTitles.cs @@ -1,4 +1,7 @@ -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/2019/T1/20190103110008_liveSetup.Designer.cs b/src/Yavsc/Migrations/2019/T1/20190103110008_liveSetup.Designer.cs index b96ddb7f..058d54be 100644 --- a/src/Yavsc/Migrations/2019/T1/20190103110008_liveSetup.Designer.cs +++ b/src/Yavsc/Migrations/2019/T1/20190103110008_liveSetup.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2019/T1/20190103110008_liveSetup.cs b/src/Yavsc/Migrations/2019/T1/20190103110008_liveSetup.cs index b321460b..76dd257b 100644 --- a/src/Yavsc/Migrations/2019/T1/20190103110008_liveSetup.cs +++ b/src/Yavsc/Migrations/2019/T1/20190103110008_liveSetup.cs @@ -1,4 +1,7 @@ -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/2019/T1/20190126133339_banTarget.Designer.cs b/src/Yavsc/Migrations/2019/T1/20190126133339_banTarget.Designer.cs index 57d51033..3283f106 100644 --- a/src/Yavsc/Migrations/2019/T1/20190126133339_banTarget.Designer.cs +++ b/src/Yavsc/Migrations/2019/T1/20190126133339_banTarget.Designer.cs @@ -19,9 +19,10 @@ // You should have received a copy of the GNU Lesser General Public License // along with this program. If not, see . using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2019/T1/20190126133339_banTarget.cs b/src/Yavsc/Migrations/2019/T1/20190126133339_banTarget.cs index d8c3ccb9..913d734c 100644 --- a/src/Yavsc/Migrations/2019/T1/20190126133339_banTarget.cs +++ b/src/Yavsc/Migrations/2019/T1/20190126133339_banTarget.cs @@ -1,4 +1,7 @@ -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/2019/T1/20190127105601_banReason.Designer.cs b/src/Yavsc/Migrations/2019/T1/20190127105601_banReason.Designer.cs index 6bc616dd..6cef5b7a 100644 --- a/src/Yavsc/Migrations/2019/T1/20190127105601_banReason.Designer.cs +++ b/src/Yavsc/Migrations/2019/T1/20190127105601_banReason.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2019/T1/20190127105601_banReason.cs b/src/Yavsc/Migrations/2019/T1/20190127105601_banReason.cs index abbbaf79..fa4d6593 100644 --- a/src/Yavsc/Migrations/2019/T1/20190127105601_banReason.cs +++ b/src/Yavsc/Migrations/2019/T1/20190127105601_banReason.cs @@ -1,4 +1,7 @@ -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/2019/T1/20190204162909_liveFlowSeqnum.Designer.cs b/src/Yavsc/Migrations/2019/T1/20190204162909_liveFlowSeqnum.Designer.cs index d9f3dae7..226b7cc9 100644 --- a/src/Yavsc/Migrations/2019/T1/20190204162909_liveFlowSeqnum.Designer.cs +++ b/src/Yavsc/Migrations/2019/T1/20190204162909_liveFlowSeqnum.Designer.cs @@ -1,7 +1,8 @@ using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2019/T1/20190204162909_liveFlowSeqnum.cs b/src/Yavsc/Migrations/2019/T1/20190204162909_liveFlowSeqnum.cs index 2fc52e75..96c34a4a 100644 --- a/src/Yavsc/Migrations/2019/T1/20190204162909_liveFlowSeqnum.cs +++ b/src/Yavsc/Migrations/2019/T1/20190204162909_liveFlowSeqnum.cs @@ -1,4 +1,7 @@ -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/2019/T2/20190507142752_chatAccess.Designer.cs b/src/Yavsc/Migrations/2019/T2/20190507142752_chatAccess.Designer.cs index 197f0e1a..67446779 100644 --- a/src/Yavsc/Migrations/2019/T2/20190507142752_chatAccess.Designer.cs +++ b/src/Yavsc/Migrations/2019/T2/20190507142752_chatAccess.Designer.cs @@ -1,7 +1,8 @@ using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2019/T2/20190507142752_chatAccess.cs b/src/Yavsc/Migrations/2019/T2/20190507142752_chatAccess.cs index e16710c1..1e1d2413 100644 --- a/src/Yavsc/Migrations/2019/T2/20190507142752_chatAccess.cs +++ b/src/Yavsc/Migrations/2019/T2/20190507142752_chatAccess.cs @@ -1,5 +1,8 @@ using System; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/2019/T2/20190508004238_dropGCM.Designer.cs b/src/Yavsc/Migrations/2019/T2/20190508004238_dropGCM.Designer.cs index 85c731ed..758c774f 100644 --- a/src/Yavsc/Migrations/2019/T2/20190508004238_dropGCM.Designer.cs +++ b/src/Yavsc/Migrations/2019/T2/20190508004238_dropGCM.Designer.cs @@ -1,7 +1,7 @@ using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2019/T2/20190508004238_dropGCM.cs b/src/Yavsc/Migrations/2019/T2/20190508004238_dropGCM.cs index 7d6a21f8..506e9475 100644 --- a/src/Yavsc/Migrations/2019/T2/20190508004238_dropGCM.cs +++ b/src/Yavsc/Migrations/2019/T2/20190508004238_dropGCM.cs @@ -1,5 +1,7 @@ using System; -using Microsoft.Data.Entity.Migrations; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/2019/T2/20190510021107_chanDates.Designer.cs b/src/Yavsc/Migrations/2019/T2/20190510021107_chanDates.Designer.cs index b38e8e4b..cb0b2f7c 100644 --- a/src/Yavsc/Migrations/2019/T2/20190510021107_chanDates.Designer.cs +++ b/src/Yavsc/Migrations/2019/T2/20190510021107_chanDates.Designer.cs @@ -1,7 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2019/T2/20190510021107_chanDates.cs b/src/Yavsc/Migrations/2019/T2/20190510021107_chanDates.cs index 4c498a6a..686a1ac0 100644 --- a/src/Yavsc/Migrations/2019/T2/20190510021107_chanDates.cs +++ b/src/Yavsc/Migrations/2019/T2/20190510021107_chanDates.cs @@ -1,5 +1,7 @@ using System; -using Microsoft.Data.Entity.Migrations; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/2019/T2/20190622172941_userTrack.Designer.cs b/src/Yavsc/Migrations/2019/T2/20190622172941_userTrack.Designer.cs index 2d59f051..22722c18 100644 --- a/src/Yavsc/Migrations/2019/T2/20190622172941_userTrack.Designer.cs +++ b/src/Yavsc/Migrations/2019/T2/20190622172941_userTrack.Designer.cs @@ -1,8 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Metadata; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/2019/T2/20190622172941_userTrack.cs b/src/Yavsc/Migrations/2019/T2/20190622172941_userTrack.cs index ed0a2b0d..095dc020 100644 --- a/src/Yavsc/Migrations/2019/T2/20190622172941_userTrack.cs +++ b/src/Yavsc/Migrations/2019/T2/20190622172941_userTrack.cs @@ -1,6 +1,8 @@ using System; using System.Collections.Generic; -using Microsoft.Data.Entity.Migrations; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/20190730164137_publicCircle.Designer.cs b/src/Yavsc/Migrations/20190730164137_publicCircle.Designer.cs index db75dea1..cea65a93 100644 --- a/src/Yavsc/Migrations/20190730164137_publicCircle.Designer.cs +++ b/src/Yavsc/Migrations/20190730164137_publicCircle.Designer.cs @@ -1,8 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Metadata; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/20190730164137_publicCircle.cs b/src/Yavsc/Migrations/20190730164137_publicCircle.cs index fb3673c3..06555278 100644 --- a/src/Yavsc/Migrations/20190730164137_publicCircle.cs +++ b/src/Yavsc/Migrations/20190730164137_publicCircle.cs @@ -1,6 +1,7 @@ -using System; -using System.Collections.Generic; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/20190803204448_fileCircle.Designer.cs b/src/Yavsc/Migrations/20190803204448_fileCircle.Designer.cs index 10b063b8..a8a910d1 100644 --- a/src/Yavsc/Migrations/20190803204448_fileCircle.Designer.cs +++ b/src/Yavsc/Migrations/20190803204448_fileCircle.Designer.cs @@ -1,8 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Metadata; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/20190803204448_fileCircle.cs b/src/Yavsc/Migrations/20190803204448_fileCircle.cs index ed946494..b21e697b 100644 --- a/src/Yavsc/Migrations/20190803204448_fileCircle.cs +++ b/src/Yavsc/Migrations/20190803204448_fileCircle.cs @@ -1,6 +1,7 @@ -using System; -using System.Collections.Generic; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/20190804232432_circleAnnotations.Designer.cs b/src/Yavsc/Migrations/20190804232432_circleAnnotations.Designer.cs index 8b02171b..4b9d6f46 100644 --- a/src/Yavsc/Migrations/20190804232432_circleAnnotations.Designer.cs +++ b/src/Yavsc/Migrations/20190804232432_circleAnnotations.Designer.cs @@ -1,8 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Metadata; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/20190804232432_circleAnnotations.cs b/src/Yavsc/Migrations/20190804232432_circleAnnotations.cs index 3e634d75..a2343a58 100644 --- a/src/Yavsc/Migrations/20190804232432_circleAnnotations.cs +++ b/src/Yavsc/Migrations/20190804232432_circleAnnotations.cs @@ -1,6 +1,7 @@ -using System; -using System.Collections.Generic; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/20190819220343_intrumentRatingConstraint.Designer.cs b/src/Yavsc/Migrations/20190819220343_intrumentRatingConstraint.Designer.cs index ee49fe6d..032ad975 100644 --- a/src/Yavsc/Migrations/20190819220343_intrumentRatingConstraint.Designer.cs +++ b/src/Yavsc/Migrations/20190819220343_intrumentRatingConstraint.Designer.cs @@ -1,8 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Metadata; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/20190819220343_intrumentRatingConstraint.cs b/src/Yavsc/Migrations/20190819220343_intrumentRatingConstraint.cs index 64f359c8..2ab2665c 100644 --- a/src/Yavsc/Migrations/20190819220343_intrumentRatingConstraint.cs +++ b/src/Yavsc/Migrations/20190819220343_intrumentRatingConstraint.cs @@ -1,6 +1,7 @@ -using System; -using System.Collections.Generic; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/20190819221632_instRateWInst.Designer.cs b/src/Yavsc/Migrations/20190819221632_instRateWInst.Designer.cs index 94faccde..1cb71985 100644 --- a/src/Yavsc/Migrations/20190819221632_instRateWInst.Designer.cs +++ b/src/Yavsc/Migrations/20190819221632_instRateWInst.Designer.cs @@ -1,8 +1,7 @@ -using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Metadata; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/20190819221632_instRateWInst.cs b/src/Yavsc/Migrations/20190819221632_instRateWInst.cs index aed62723..65b1208d 100644 --- a/src/Yavsc/Migrations/20190819221632_instRateWInst.cs +++ b/src/Yavsc/Migrations/20190819221632_instRateWInst.cs @@ -1,6 +1,7 @@ -using System; -using System.Collections.Generic; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/20190826132314_bugDescriptionLength.Designer.cs b/src/Yavsc/Migrations/20190826132314_bugDescriptionLength.Designer.cs index 88a36091..32c8f81d 100644 --- a/src/Yavsc/Migrations/20190826132314_bugDescriptionLength.Designer.cs +++ b/src/Yavsc/Migrations/20190826132314_bugDescriptionLength.Designer.cs @@ -1,8 +1,7 @@ using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Metadata; -using Microsoft.Data.Entity.Migrations; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/20190826132314_bugDescriptionLength.cs b/src/Yavsc/Migrations/20190826132314_bugDescriptionLength.cs index 57332b56..9295e86a 100644 --- a/src/Yavsc/Migrations/20190826132314_bugDescriptionLength.cs +++ b/src/Yavsc/Migrations/20190826132314_bugDescriptionLength.cs @@ -1,6 +1,7 @@ -using System; -using System.Collections.Generic; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/20210530122042_template-key.Designer.cs b/src/Yavsc/Migrations/20210530122042_template-key.Designer.cs index 9eb6701a..7ef31cf5 100644 --- a/src/Yavsc/Migrations/20210530122042_template-key.Designer.cs +++ b/src/Yavsc/Migrations/20210530122042_template-key.Designer.cs @@ -1,8 +1,7 @@ using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Metadata; -using Microsoft.Data.Entity.Migrations; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/20210530122042_template-key.cs b/src/Yavsc/Migrations/20210530122042_template-key.cs index a8c3b6e4..1a20c14f 100644 --- a/src/Yavsc/Migrations/20210530122042_template-key.cs +++ b/src/Yavsc/Migrations/20210530122042_template-key.cs @@ -1,6 +1,7 @@ using System; -using System.Collections.Generic; -using Microsoft.Data.Entity.Migrations; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/20210530213408_mailling-not-mailling-lists.Designer.cs b/src/Yavsc/Migrations/20210530213408_mailling-not-mailling-lists.Designer.cs index 74d5baa5..a7d29e3d 100644 --- a/src/Yavsc/Migrations/20210530213408_mailling-not-mailling-lists.Designer.cs +++ b/src/Yavsc/Migrations/20210530213408_mailling-not-mailling-lists.Designer.cs @@ -1,8 +1,7 @@ using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Metadata; -using Microsoft.Data.Entity.Migrations; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/20210530213408_mailling-not-mailling-lists.cs b/src/Yavsc/Migrations/20210530213408_mailling-not-mailling-lists.cs index 30009cec..e452fe45 100644 --- a/src/Yavsc/Migrations/20210530213408_mailling-not-mailling-lists.cs +++ b/src/Yavsc/Migrations/20210530213408_mailling-not-mailling-lists.cs @@ -1,6 +1,7 @@ using System; -using System.Collections.Generic; -using Microsoft.Data.Entity.Migrations; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { diff --git a/src/Yavsc/Migrations/20210603172023_no-more-circle-autorisation-to-file.Designer.cs b/src/Yavsc/Migrations/20210603172023_no-more-circle-autorisation-to-file.Designer.cs index 8557de03..473dc175 100644 --- a/src/Yavsc/Migrations/20210603172023_no-more-circle-autorisation-to-file.Designer.cs +++ b/src/Yavsc/Migrations/20210603172023_no-more-circle-autorisation-to-file.Designer.cs @@ -1,8 +1,8 @@ using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Metadata; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Migrations/20210603172023_no-more-circle-autorisation-to-file.cs b/src/Yavsc/Migrations/20210603172023_no-more-circle-autorisation-to-file.cs index 450e09b1..d75c6dd2 100644 --- a/src/Yavsc/Migrations/20210603172023_no-more-circle-autorisation-to-file.cs +++ b/src/Yavsc/Migrations/20210603172023_no-more-circle-autorisation-to-file.cs @@ -1,7 +1,8 @@ using System; using System.Collections.Generic; -using Microsoft.Data.Entity.Migrations; - +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace Yavsc.Migrations { public partial class nomorecircleautorisationtofile : Migration diff --git a/src/Yavsc/Migrations/ApplicationDbContextModelSnapshot.cs b/src/Yavsc/Migrations/ApplicationDbContextModelSnapshot.cs index 7d87b4d2..991ba507 100644 --- a/src/Yavsc/Migrations/ApplicationDbContextModelSnapshot.cs +++ b/src/Yavsc/Migrations/ApplicationDbContextModelSnapshot.cs @@ -1,8 +1,8 @@ using System; -using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Metadata; -using Microsoft.Data.Entity.Migrations; + +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/src/Yavsc/Models/ApplicationDbContext.cs b/src/Yavsc/Models/ApplicationDbContext.cs index 20498690..66a48015 100644 --- a/src/Yavsc/Models/ApplicationDbContext.cs +++ b/src/Yavsc/Models/ApplicationDbContext.cs @@ -2,8 +2,6 @@ using System; using System.Linq; using System.Threading.Tasks; -using Microsoft.AspNet.Identity.EntityFramework; -using Microsoft.Data.Entity; using System.Threading; using Yavsc.Models.Haircut; using Yavsc.Models.IT.Evolution; @@ -38,6 +36,9 @@ namespace Yavsc.Models using Blog; using Yavsc.Abstract.Identity; using Yavsc.Server.Models.Blog; + using Microsoft.EntityFrameworkCore; + using Microsoft.AspNetCore.Identity.EntityFrameworkCore; + using Yavsc.Server.Models.Calendar; public class ApplicationDbContext : IdentityDbContext { @@ -72,7 +73,7 @@ namespace Yavsc.Models foreach (var et in builder.Model.GetEntityTypes()) { if (et.ClrType.GetInterface("IBaseTrackedEntity") != null) - et.FindProperty("DateCreated").IsReadOnlyAfterSave = true; + et.FindProperty("DateCreated").SetAfterSaveBehavior(Microsoft.EntityFrameworkCore.Metadata.PropertySaveBehavior.Ignore); } } diff --git a/src/Yavsc/Models/ErrorViewModel.cs b/src/Yavsc/Models/ErrorViewModel.cs new file mode 100644 index 00000000..82a4ea85 --- /dev/null +++ b/src/Yavsc/Models/ErrorViewModel.cs @@ -0,0 +1,9 @@ +namespace Yavsc.Models; + +public class ErrorViewModel +{ + public string? RequestId { get; set; } + + public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); + +} diff --git a/src/Yavsc/Program.cs b/src/Yavsc/Program.cs new file mode 100644 index 00000000..07274680 --- /dev/null +++ b/src/Yavsc/Program.cs @@ -0,0 +1,27 @@ +var builder = WebApplication.CreateBuilder(args); + +// Add services to the container. +builder.Services.AddControllersWithViews(); + +var app = builder.Build(); + +// Configure the HTTP request pipeline. +if (!app.Environment.IsDevelopment()) +{ + app.UseExceptionHandler("/Home/Error"); + // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. + app.UseHsts(); +} + +app.UseHttpsRedirection(); +app.UseStaticFiles(); + +app.UseRouting(); + +app.UseAuthorization(); + +app.MapControllerRoute( + name: "default", + pattern: "{controller=Home}/{action=Index}/{id?}"); + +app.Run(); diff --git a/src/Yavsc/Properties/launchSettings.json b/src/Yavsc/Properties/launchSettings.json index 57bd1e7f..c7aa64d5 100644 --- a/src/Yavsc/Properties/launchSettings.json +++ b/src/Yavsc/Properties/launchSettings.json @@ -1,25 +1,36 @@ -{ +{ "iisSettings": { "windowsAuthentication": false, "anonymousAuthentication": true, "iisExpress": { - "applicationUrl": "http://localhost:40088/", - "sslPort": 0 + "applicationUrl": "http://localhost:30089", + "sslPort": 44391 } }, "profiles": { - "IIS Express": { - "commandName": "IISExpress", + "http": { + "commandName": "Project", + "dotnetRunMessages": true, "launchBrowser": true, + "applicationUrl": "http://localhost:5172", "environmentVariables": { - "ASPNET_ENV": "Development" + "ASPNETCORE_ENVIRONMENT": "Development" } }, - "web": { - "commandName": "web", + "https": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "applicationUrl": "https://localhost:7062;http://localhost:5172", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, "environmentVariables": { - "Hosting:Environment": "Development", - "ASPNET_ENV": "Development" + "ASPNETCORE_ENVIRONMENT": "Development" } } } diff --git a/src/Yavsc/Services/BillingService.cs b/src/Yavsc/Services/BillingService.cs index 008deb62..76fdac04 100644 --- a/src/Yavsc/Services/BillingService.cs +++ b/src/Yavsc/Services/BillingService.cs @@ -1,12 +1,7 @@ -using System; -using System.Collections.Generic; -using System.Linq; using System.Reflection; -using System.Threading.Tasks; -using Microsoft.Extensions.Logging; +using Microsoft.EntityFrameworkCore; using Yavsc.Abstract.Workflow; using Yavsc.Models; -using Microsoft.Data.Entity; namespace Yavsc.Services { diff --git a/src/Yavsc/Services/DiskUsageTracker.cs b/src/Yavsc/Services/DiskUsageTracker.cs index 8c01e4ed..eda3f027 100644 --- a/src/Yavsc/Services/DiskUsageTracker.cs +++ b/src/Yavsc/Services/DiskUsageTracker.cs @@ -1,9 +1,4 @@ - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.Extensions.OptionsModel; +using Microsoft.Extensions.Options; using Yavsc; using Yavsc.Models; using Yavsc.Services; diff --git a/src/Yavsc/Services/EMailer.cs b/src/Yavsc/Services/EMailer.cs index 2b5a03a2..bc807248 100644 --- a/src/Yavsc/Services/EMailer.cs +++ b/src/Yavsc/Services/EMailer.cs @@ -1,24 +1,20 @@ -// // EMailer.cs +using System.Text; +// // EMailer.cs // /* // paul 26/06/2018 12:18 20182018 6 26 // */ -using System; -using Microsoft.AspNet.Razor; using Yavsc.Templates; using Microsoft.CodeAnalysis; using Microsoft.Extensions.Localization; -using Microsoft.Extensions.Logging; -using Microsoft.AspNet.Identity.EntityFramework; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.Emit; using Yavsc.Models; using Yavsc.Services; -using System.Collections.Generic; -using System.Linq; -using System.IO; using System.Reflection; using Yavsc.Abstract.Templates; +using Microsoft.AspNetCore.Identity; +using RazorEngine.Configuration; namespace Yavsc.Lib { @@ -26,16 +22,20 @@ namespace Yavsc.Lib { const string DefaultBaseClassName = "ATemplate"; const string DefaultBaseClass = nameof(UserOrientedTemplate); - const string DefaultNamespace = "CompiledRazorTemplates"; - readonly RazorTemplateEngine razorEngine; + ISet Namespaces = new System.Collections.Generic.HashSet { + "System", + "Yavsc.Templates" , + "Yavsc.Models", + "Yavsc.Models.Identity"}; + readonly IStringLocalizer stringLocalizer; readonly ApplicationDbContext dbContext; readonly IEmailSender mailSender; - readonly RazorEngineHost host; + readonly ILogger logger; - public EMailer(ApplicationDbContext context, IEmailSender sender, - IStringLocalizer localizer, + public EMailer(ApplicationDbContext context, IEmailSender sender, + IStringLocalizer localizer, ILoggerFactory loggerFactory) { stringLocalizer = localizer; @@ -43,24 +43,15 @@ namespace Yavsc.Lib logger = loggerFactory.CreateLogger(); - var language = new CSharpRazorCodeLanguage(); - host = new RazorEngineHost(language) + var templateServiceConfig = new TemplateServiceConfiguration() { - DefaultBaseClass = DefaultBaseClass, - DefaultClassName = DefaultBaseClassName, - DefaultNamespace = DefaultNamespace + BaseTemplateType = typeof(UserOrientedTemplate), + Language = RazorEngine.Language.CSharp, + Namespaces = Namespaces + }; - host.NamespaceImports.Add("System"); - host.NamespaceImports.Add("Yavsc.Templates"); - host.NamespaceImports.Add("Yavsc.Models"); - host.NamespaceImports.Add("Yavsc.Models.Identity"); - host.NamespaceImports.Add("Microsoft.AspNet.Identity.EntityFramework"); - host.InstrumentedSourceFilePath = "."; - host.StaticHelpers = true; - dbContext = context; - razorEngine = new RazorTemplateEngine(host); } public void SendMonthlyEmail(string templateCode, string baseclassName = DefaultBaseClassName) @@ -70,9 +61,11 @@ namespace Yavsc.Lib string subtemp = stringLocalizer["MonthlySubjectTemplate"].Value; logger.LogInformation($"Generating {subtemp}[{className}]"); - - + + var templateInfo = dbContext.MailingTemplate.FirstOrDefault(t => t.Id == templateCode); + var templatekey = RazorEngine.Engine.Razor.GetKey(templateInfo.Id); + logger.LogInformation($"Using code: {templateCode}, subject: {subtemp} "); logger.LogInformation("And body:\n" + templateInfo.Body); @@ -80,16 +73,20 @@ namespace Yavsc.Lib { // Generate code for the template - var razorResult = razorEngine.GenerateCode(reader, className, DefaultNamespace, DefaultNamespace + ".cs"); + using (var rzcode = new MemoryStream()) + { + using (var writter = new StreamWriter(rzcode)) + { + RazorEngine.Engine.Razor.Run(templatekey, writter); + rzcode.Seek(0, SeekOrigin.Begin); + + SyntaxTree syntaxTree = CSharpSyntaxTree.ParseText(Encoding.Default.GetString(rzcode.ToArray())); - logger.LogInformation("Razor exited " + (razorResult.Success ? "Ok" : "Ko") + "."); - logger.LogInformation(razorResult.GeneratedCode); - SyntaxTree syntaxTree = CSharpSyntaxTree.ParseText(razorResult.GeneratedCode); - logger.LogInformation("CSharp parsed"); - List references = new List(); + logger.LogInformation("CSharp parsed"); + List references = new List(); - foreach (var type in new Type[] { + foreach (var type in new Type[] { typeof(object), typeof(Enumerable), typeof(IdentityUser), @@ -98,78 +95,80 @@ namespace Yavsc.Lib typeof(UserOrientedTemplate), typeof(System.Threading.Tasks.TaskExtensions) }) - { - var location = type.Assembly.Location; - if (!string.IsNullOrWhiteSpace(location)) - { - references.Add( - MetadataReference.CreateFromFile(location) - ); - logger.LogInformation($"Assembly for {type.Name} found at {location}"); - } - else logger.LogWarning($"Assembly Not found for {type.Name}"); - } - - logger.LogInformation("Compilation creation ..."); - - var compilationOptions = new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary) - .WithAllowUnsafe(true).WithOptimizationLevel(OptimizationLevel.Debug) - .WithOutputKind(OutputKind.DynamicallyLinkedLibrary).WithPlatform(Platform.AnyCpu) - .WithUsings("Yavsc.Templates") - ; - string assemblyName = DefaultNamespace; - CSharpCompilation compilation = CSharpCompilation.Create( - assemblyName, - syntaxTrees: new[] { syntaxTree }, - references: references, - options: compilationOptions - ); - - using (var ms = new MemoryStream()) - { - logger.LogInformation("Emitting result ..."); - EmitResult result = compilation.Emit(ms); - foreach (Diagnostic diagnostic in result.Diagnostics.Where(diagnostic => - diagnostic.Severity < DiagnosticSeverity.Error && !diagnostic.IsWarningAsError)) - { - logger.LogWarning("{0}: {1}", diagnostic.Id, diagnostic.GetMessage()); - logger.LogWarning("{0}: {1}", diagnostic.Id, diagnostic.Location.GetLineSpan()); - } - if (!result.Success) - { - logger.LogInformation(razorResult.GeneratedCode); - IEnumerable failures = result.Diagnostics.Where(diagnostic => - diagnostic.IsWarningAsError || - diagnostic.Severity == DiagnosticSeverity.Error); - foreach (Diagnostic diagnostic in failures) { - logger.LogCritical("{0}: {1}", diagnostic.Id, diagnostic.GetMessage()); - logger.LogCritical("{0}: {1}", diagnostic.Id, diagnostic.Location.GetLineSpan()); + var location = type.Assembly.Location; + if (!string.IsNullOrWhiteSpace(location)) + { + references.Add( + MetadataReference.CreateFromFile(location) + ); + logger.LogInformation($"Assembly for {type.Name} found at {location}"); + } + else logger.LogWarning($"Assembly Not found for {type.Name}"); } - } - else - { - logger.LogInformation(razorResult.GeneratedCode); - ms.Seek(0, SeekOrigin.Begin); - Assembly assembly = Assembly.Load(ms.ToArray()); - - Type type = assembly.GetType(DefaultNamespace + "." + className); - var generatedtemplate = (UserOrientedTemplate)Activator.CreateInstance(type); - foreach (var user in dbContext.ApplicationUser.Where( - u => u.AllowMonthlyEmail - )) + + logger.LogInformation("Compilation creation ..."); + + var compilationOptions = new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary) + .WithAllowUnsafe(true).WithOptimizationLevel(OptimizationLevel.Debug) + .WithOutputKind(OutputKind.DynamicallyLinkedLibrary).WithPlatform(Platform.AnyCpu) + .WithUsings("Yavsc.Templates") + ; + string assemblyName = "EMailSenderTemplate"; + CSharpCompilation compilation = CSharpCompilation.Create( + assemblyName, + syntaxTrees: new[] { syntaxTree }, + references: references, + options: compilationOptions + ); + + using (var ms = new MemoryStream()) { - logger.LogInformation("Generation for " + user.UserName); - generatedtemplate.Init(); - generatedtemplate.User = user; - generatedtemplate.ExecuteAsync(); - logger.LogInformation(generatedtemplate.GeneratedText); + logger.LogInformation("Emitting result ..."); + EmitResult result = compilation.Emit(ms); + foreach (Diagnostic diagnostic in result.Diagnostics.Where(diagnostic => + diagnostic.Severity < DiagnosticSeverity.Error && !diagnostic.IsWarningAsError)) + { + logger.LogWarning("{0}: {1}", diagnostic.Id, diagnostic.GetMessage()); + logger.LogWarning("{0}: {1}", diagnostic.Id, diagnostic.Location.GetLineSpan()); + } + if (!result.Success) + { + + IEnumerable failures = result.Diagnostics.Where(diagnostic => + diagnostic.IsWarningAsError || + diagnostic.Severity == DiagnosticSeverity.Error); + foreach (Diagnostic diagnostic in failures) + { + logger.LogCritical("{0}: {1}", diagnostic.Id, diagnostic.GetMessage()); + logger.LogCritical("{0}: {1}", diagnostic.Id, diagnostic.Location.GetLineSpan()); + } + } + else + { + + ms.Seek(0, SeekOrigin.Begin); + Assembly assembly = Assembly.Load(ms.ToArray()); + + Type type = assembly.GetType(Namespaces + "." + className); + var generatedtemplate = (UserOrientedTemplate)Activator.CreateInstance(type); + foreach (var user in dbContext.ApplicationUser.Where( + u => u.AllowMonthlyEmail + )) + { + logger.LogInformation("Generation for " + user.UserName); + generatedtemplate.Init(); + generatedtemplate.User = user; + generatedtemplate.ExecuteAsync(); + logger.LogInformation(generatedtemplate.GeneratedText); + } + + } } - } + } } - } } } diff --git a/src/Yavsc/Services/FileSystemAuthManager.cs b/src/Yavsc/Services/FileSystemAuthManager.cs index 610af026..fe17f2fc 100644 --- a/src/Yavsc/Services/FileSystemAuthManager.cs +++ b/src/Yavsc/Services/FileSystemAuthManager.cs @@ -1,14 +1,10 @@ -using System; -using System.Linq; -using System.Security.Principal; using System.Security.Claims; -using Yavsc.Models; -using Microsoft.Extensions.Logging; -using Microsoft.Extensions.OptionsModel; -using System.IO; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.FileProviders; +using Microsoft.Extensions.Options; using rules; -using Microsoft.Data.Entity; -using Microsoft.AspNet.FileProviders; +using Yavsc.Helpers; +using Yavsc.Models; namespace Yavsc.Services { diff --git a/src/Yavsc/Services/GoogleApis/CalendarManager.cs b/src/Yavsc/Services/GoogleApis/CalendarManager.cs index 84db3412..efdd6f90 100644 --- a/src/Yavsc/Services/GoogleApis/CalendarManager.cs +++ b/src/Yavsc/Services/GoogleApis/CalendarManager.cs @@ -19,23 +19,14 @@ // You should have received a copy of the GNU Lesser General Public License // along with this program. If not, see . -using System; -using System.Threading.Tasks; -using Microsoft.Extensions.Logging; -using Microsoft.Extensions.OptionsModel; using Google.Apis.Auth.OAuth2; -using Google.Apis.Util.Store; using Google.Apis.Calendar.v3; using Google.Apis.Calendar.v3.Data; -using System.Collections.Generic; -using System.Linq; using Google.Apis.Services; -using Google.Apis.Auth.OAuth2.Flows; using Google.Apis.Auth.OAuth2.Responses; namespace Yavsc.Services { - using Yavsc.Models; using Yavsc.Models.Calendar; using Yavsc.Server.Helpers; using Yavsc.ViewModels.Calendar; diff --git a/src/Yavsc/Services/IFileSystemAuthManager.cs b/src/Yavsc/Services/IFileSystemAuthManager.cs index c550182f..c28cd0c3 100644 --- a/src/Yavsc/Services/IFileSystemAuthManager.cs +++ b/src/Yavsc/Services/IFileSystemAuthManager.cs @@ -1,7 +1,6 @@ -using System; + using System.Security.Claims; -using System.Security.Principal; -using Microsoft.AspNet.FileProviders; +using Microsoft.Extensions.FileProviders; namespace Yavsc.Services { diff --git a/src/Yavsc/Services/LiveProcessor.cs b/src/Yavsc/Services/LiveProcessor.cs index 402b735a..87c13114 100644 --- a/src/Yavsc/Services/LiveProcessor.cs +++ b/src/Yavsc/Services/LiveProcessor.cs @@ -1,21 +1,7 @@ -using System; using System.Collections.Concurrent; -using System.Collections.Generic; -using System.IO; -using System.Linq; using System.Net.WebSockets; -using System.Security.Claims; -using System.Threading; -using System.Threading.Tasks; -using Microsoft.AspNet.Http; -using Microsoft.AspNet.SignalR; -using Microsoft.Data.Entity; -using Microsoft.Extensions.Logging; -using Yavsc.Helpers; using Yavsc.Models; using Yavsc.ViewModels.Streaming; -using Yavsc.Models.Messaging; -using Yavsc.Models.FileSystem; using Newtonsoft.Json; namespace Yavsc.Services diff --git a/src/Yavsc/Services/MailSender.cs b/src/Yavsc/Services/MailSender.cs index 08773886..bfaf5c5b 100644 --- a/src/Yavsc/Services/MailSender.cs +++ b/src/Yavsc/Services/MailSender.cs @@ -4,7 +4,7 @@ using System.Threading.Tasks; using MailKit.Net.Smtp; using MailKit.Security; using Microsoft.Extensions.Logging; -using Microsoft.Extensions.OptionsModel; +using Microsoft.Extensions.Options; using MimeKit; using Yavsc.Abstract.Manage; @@ -44,7 +44,7 @@ namespace Yavsc.Services EmailSentViewModel model = new EmailSentViewModel{ EMail = email }; try { - logger.LogInformation($"SendEmailAsync for {email}: {message}"); + logger.LogInformation($"sendEmail for {email} : {message}"); MimeMessage msg = new MimeMessage(); msg.From.Add(new MailboxAddress( siteSettings.Owner.Name, diff --git a/src/Yavsc/Services/YavscMessageSender.cs b/src/Yavsc/Services/YavscMessageSender.cs index b5c52d6c..a08f855b 100644 --- a/src/Yavsc/Services/YavscMessageSender.cs +++ b/src/Yavsc/Services/YavscMessageSender.cs @@ -1,10 +1,5 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNet.SignalR; -using Microsoft.Extensions.Logging; -using Microsoft.Extensions.OptionsModel; +using Microsoft.AspNetCore.SignalR; +using Microsoft.Extensions.Options; using Newtonsoft.Json; using Yavsc.Interfaces.Workflow; using Yavsc.Models; @@ -19,22 +14,23 @@ namespace Yavsc.Services private readonly ILogger _logger; readonly IEmailSender _emailSender; readonly SiteSettings siteSettings; - private readonly IHubContext hubContext; readonly ApplicationDbContext _dbContext; readonly IConnexionManager _cxManager; + private readonly IHubContext hubContext; public YavscMessageSender( ILoggerFactory loggerFactory, IOptions sitesOptions, IEmailSender emailSender, ApplicationDbContext dbContext, - IConnexionManager cxManager + IConnexionManager cxManager, + IHubContext hubContext ) { _logger = loggerFactory.CreateLogger(); _emailSender = emailSender; siteSettings = sitesOptions?.Value; - hubContext = GlobalHost.ConnectionManager.GetHubContext(); + this.hubContext = hubContext; _dbContext = dbContext; _cxManager = cxManager; } @@ -129,7 +125,7 @@ namespace Yavsc.Services { ["event"] = JsonConvert.SerializeObject(ev) }; - hubClient.push(ev.Topic, JsonConvert.SerializeObject(data)); + await hubClient.SendAsync("push", ev.Topic, JsonConvert.SerializeObject(data)); } result.message_id = MimeKit.Utils.MimeUtils.GenerateMessageId( diff --git a/src/Yavsc/Startup/BundleConfig.cs b/src/Yavsc/Startup/BundleConfig.cs deleted file mode 100644 index 634b8d27..00000000 --- a/src/Yavsc/Startup/BundleConfig.cs +++ /dev/null @@ -1,28 +0,0 @@ - -using System.Web.Optimization; - -namespace Yavsc -{ - public class BundleConfig - { - public static void RegisterBundles(BundleCollection bundles) - { - bundles.Add(new ScriptBundle("~/bundles/bootjq").Include( - "~/bower_components/bootstrap/dist/js", - "~/bower_components/jquery/dist/js", - "~/bower_components/jquery.validation/dist/js", - "~/bower_components/jquery-validation-unobtrusive/dist/js", - "~/bower_components/bootstrap-datepicker/dist/js")); - bundles.Add(new StyleBundle("~/Content/themes/base/css").Include( - )); - bundles.Add(new ScriptBundle("~/bundles/markdown").Include( - "~/bower_components/dropzone/dist/min/dropzone-amd-module.min.js", - "~/bower_components/dropzone/dist/min/dropzone.min.js" - )); - bundles.Add(new StyleBundle("~/Content/markdown").Include( - "~/bower_components/dropzone/dist/min/basic.min.css", - "~/bower_components/dropzone/dist/min/dropzone.min.css" - )); - } - } -} diff --git a/src/Yavsc/Startup/SendFileWrapper.cs b/src/Yavsc/Startup/SendFileWrapper.cs index e8754743..40143b49 100644 --- a/src/Yavsc/Startup/SendFileWrapper.cs +++ b/src/Yavsc/Startup/SendFileWrapper.cs @@ -1,14 +1,15 @@ using System; using System.IO; +using System.IO.Pipelines; using System.Threading; using System.Threading.Tasks; -using Microsoft.AspNet.Http.Features; +using Microsoft.AspNetCore.Http.Features; using Microsoft.Extensions.Logging; namespace Yavsc { - class YaSendFileWrapper : IHttpSendFileFeature + class YaSendFileWrapper : IHttpResponseBodyFeature { private readonly Stream _output; @@ -56,9 +57,28 @@ namespace Yavsc private const int maxbufferlen = 65536; + public Stream Stream => throw new NotImplementedException(); + + public PipeWriter Writer => throw new NotImplementedException(); + private async Task CopyToAsync(FileStream fileStream, Stream output) { await Task.Run(() => fileStream.CopyTo(output, maxbufferlen)); } + + public void DisableBuffering() + { + throw new NotImplementedException(); + } + + public Task StartAsync(CancellationToken cancellationToken = default) + { + throw new NotImplementedException(); + } + + public Task CompleteAsync() + { + throw new NotImplementedException(); + } } } diff --git a/src/Yavsc/Startup/Startup.DataProtection.cs b/src/Yavsc/Startup/Startup.DataProtection.cs deleted file mode 100644 index 3079e568..00000000 --- a/src/Yavsc/Startup/Startup.DataProtection.cs +++ /dev/null @@ -1,39 +0,0 @@ - -using System; -using System.IO; -using System.Web; -using Microsoft.AspNet.DataProtection.Infrastructure; -using Microsoft.Extensions.DependencyInjection; - -namespace Yavsc -{ - public partial class Startup - { - public void ConfigureProtectionServices(IServiceCollection services) - { - - services.AddDataProtection(); - services.Add(ServiceDescriptor.Singleton(typeof(IApplicationDiscriminator), - typeof(SystemWebApplicationDiscriminator))); - - services.ConfigureDataProtection(configure => - { - configure.SetApplicationName(Configuration["Site:Title"]); - configure.SetDefaultKeyLifetime(TimeSpan.FromDays(45)); - configure.PersistKeysToFileSystem( - new DirectoryInfo(Configuration["DataProtection:Keys:Dir"])); - }); - } - public sealed class SystemWebApplicationDiscriminator : IApplicationDiscriminator - { - private readonly Lazy _lazyDiscriminator = new Lazy(GetAppDiscriminatorCore); - - public string Discriminator => _lazyDiscriminator.Value; - - private static string GetAppDiscriminatorCore() - { - return HttpRuntime.AppDomainAppId; - } - } - } -} diff --git a/src/Yavsc/Startup/Startup.FileServer.cs b/src/Yavsc/Startup/Startup.FileServer.cs index 898a2a04..9d5522ad 100644 --- a/src/Yavsc/Startup/Startup.FileServer.cs +++ b/src/Yavsc/Startup/Startup.FileServer.cs @@ -1,17 +1,7 @@ -using System; -using System.IO; -using System.Security.Claims; -using System.Threading.Tasks; -using Microsoft.AspNet.Authorization; -using Microsoft.AspNet.Builder; -using Microsoft.AspNet.FileProviders; -using Microsoft.AspNet.Hosting; -using Microsoft.AspNet.Http; -using Microsoft.AspNet.Http.Features; -using Microsoft.AspNet.StaticFiles; -using Microsoft.Extensions.Logging; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.StaticFiles; +using Microsoft.Extensions.FileProviders; using Yavsc.Helpers; -using Yavsc.Services; using Yavsc.ViewModels.Auth; namespace Yavsc @@ -52,7 +42,7 @@ namespace Yavsc static IAuthorizationService AuthorizationService { get; set; } public void ConfigureFileServerApp(IApplicationBuilder app, - SiteSettings siteSettings, IHostingEnvironment env, + SiteSettings siteSettings, Microsoft.AspNetCore.Hosting.IHostingEnvironment env, IAuthorizationService authorizationService) { AuthorizationService = authorizationService; @@ -113,7 +103,7 @@ namespace Yavsc var path = context.Context.Request.Path; var result = await AuthorizationService.AuthorizeAsync(context.Context.User, new ViewFileContext{ UserName = uname, File = context.File, Path = path }, new ViewRequirement()); - if (!result) + if (!result.Succeeded) { _logger.LogInformation("403"); // TODO prettier diff --git a/src/Yavsc/Startup/Startup.OAuth.cs b/src/Yavsc/Startup/Startup.OAuth.cs deleted file mode 100644 index d17f6fa9..00000000 --- a/src/Yavsc/Startup/Startup.OAuth.cs +++ /dev/null @@ -1,225 +0,0 @@ -using System; -using System.Security.Claims; -using Google.Apis.Auth.OAuth2.Responses; -using Google.Apis.Util.Store; -using Microsoft.AspNet.Authentication; -using Microsoft.AspNet.Authentication.Cookies; -using Microsoft.AspNet.Authentication.Facebook; -using Microsoft.AspNet.Authentication.JwtBearer; -using Microsoft.AspNet.Authentication.OAuth; -using Microsoft.AspNet.Authentication.Twitter; -using Microsoft.AspNet.Builder; -using Microsoft.AspNet.Http; -using Microsoft.AspNet.Identity; -using Microsoft.AspNet.Identity.EntityFramework; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Logging; -using Microsoft.Extensions.OptionsModel; -using Microsoft.Extensions.WebEncoders; -using OAuth.AspNet.AuthServer; -using OAuth.AspNet.Tokens; - -namespace Yavsc -{ - using System.Threading.Tasks; - using Auth; - using Extensions; - using Models; - using Yavsc.Helpers.Auth; - - public partial class Startup - { - public static CookieAuthenticationOptions ExternalCookieAppOptions { get; private set; } - - public static IdentityOptions IdentityAppOptions { get; set; } - public static FacebookOptions FacebookAppOptions { get; private set; } - - public static TwitterOptions TwitterAppOptions { get; private set; } - public static OAuthAuthorizationServerOptions OAuthServerAppOptions { get; private set; } - - public static YavscGoogleOptions YavscGoogleAppOptions { get; private set; } - public static MonoDataProtectionProvider ProtectionProvider { get; private set; } - - // public static CookieAuthenticationOptions BearerCookieOptions { get; private set; } - - private void ConfigureOAuthServices(IServiceCollection services) - { - services.Configure(options => options.SignInScheme = Constants.ApplicationAuthenticationSheme); - - services.Add(ServiceDescriptor.Singleton(typeof(IOptions), typeof(OptionsManager))); - // used by the YavscGoogleOAuth middelware (TODO drop it) - services.AddTransient(); - - services.AddAuthentication(options => - { - options.SignInScheme = Constants.ExternalAuthenticationSheme; - }); - - ProtectionProvider = new MonoDataProtectionProvider(Configuration["Site:Title"]); ; - services.AddInstance - (ProtectionProvider); - - services.AddIdentity( - option => - { - IdentityAppOptions = option; - option.User.RequireUniqueEmail = true; - option.Cookies.ApplicationCookie.LoginPath = "/signin"; - } - ).AddEntityFrameworkStores() - .AddTokenProvider>(Constants.DefaultFactor) - // .AddTokenProvider(Constants.DefaultFactor) - // .AddTokenProvider(Constants.SMSFactor) - .AddTokenProvider(Constants.EMailFactor) - // .AddTokenProvider(Constants.AppFactor) - // - ; - } - private void ConfigureOAuthApp(IApplicationBuilder app) - { - - app.UseIdentity(); - app.UseWhen(context => context.Request.Path.StartsWithSegments("/api") - || context.Request.Path.StartsWithSegments("/live"), - branchLiveOrApi => - { - branchLiveOrApi.UseJwtBearerAuthentication( - options => - { - options.AuthenticationScheme = JwtBearerDefaults.AuthenticationScheme; - options.AutomaticAuthenticate = true; - options.SecurityTokenValidators.Clear(); - var tickeDataProtector = new TicketDataFormatTokenValidator( - ProtectionProvider - ); - options.SecurityTokenValidators.Add(tickeDataProtector); - options.Events = new JwtBearerEvents - { - OnReceivingToken = context => - { - return Task.Run(() => - { - var signalRTokenHeader = context.Request.Query["signalRTokenHeader"]; - - if (!string.IsNullOrEmpty(signalRTokenHeader) && - (context.HttpContext.WebSockets.IsWebSocketRequest || context.Request.Headers["Accept"] == "text/event-stream")) - { - context.Token = context.Request.Query["signalRTokenHeader"]; - } - }); - } - }; - }); - }); - app.UseWhen(context => !context.Request.Path.StartsWithSegments("/api") && !context.Request.Path.StartsWithSegments("/live"), - branch => - { - // External authentication shared cookie: - branch.UseCookieAuthentication(options => - { - ExternalCookieAppOptions = options; - options.AuthenticationScheme = Constants.ExternalAuthenticationSheme; - options.AutomaticAuthenticate = true; - options.ExpireTimeSpan = TimeSpan.FromMinutes(5); - options.LoginPath = new PathString(Constants.LoginPath.Substring(1)); - options.AccessDeniedPath = new PathString(Constants.LoginPath.Substring(1)); - }); - - YavscGoogleAppOptions = new YavscGoogleOptions - { - ClientId = GoogleWebClientConfiguration["web:client_id"], - ClientSecret = GoogleWebClientConfiguration["web:client_secret"], - AccessType = "offline", - Scope = { - "profile", - "https://www.googleapis.com/auth/admin.directory.resource.calendar", - "https://www.googleapis.com/auth/calendar", - "https://www.googleapis.com/auth/calendar.events" - }, - SaveTokensAsClaims = true, - UserInformationEndpoint = "https://www.googleapis.com/plus/v1/people/me", - Events = new OAuthEvents - { - OnCreatingTicket = async context => - { - using (var serviceScope = app.ApplicationServices.GetRequiredService() - .CreateScope()) - { - var gcontext = context as GoogleOAuthCreatingTicketContext; - context.Identity.AddClaim(new Claim(YavscClaimTypes.GoogleUserId, gcontext.GoogleUserId)); - var dbContext = serviceScope.ServiceProvider.GetService(); - - var store = serviceScope.ServiceProvider.GetService(); - await store.StoreAsync(gcontext.GoogleUserId, new TokenResponse - { - AccessToken = gcontext.TokenResponse.AccessToken, - RefreshToken = gcontext.TokenResponse.RefreshToken, - TokenType = gcontext.TokenResponse.TokenType, - ExpiresInSeconds = int.Parse(gcontext.TokenResponse.ExpiresIn), - IssuedUtc = DateTime.Now - }); - await dbContext.StoreTokenAsync(gcontext.GoogleUserId, - gcontext.TokenResponse.Response, - gcontext.TokenResponse.AccessToken, - gcontext.TokenResponse.TokenType, - gcontext.TokenResponse.RefreshToken, - gcontext.TokenResponse.ExpiresIn); - - } - } - } - }; - - branch.UseMiddleware(YavscGoogleAppOptions); - /* FIXME 403 - - branch.UseTwitterAuthentication(options=> - { - TwitterAppOptions = options; - options.ConsumerKey = Configuration["Authentication:Twitter:ClientId"]; - options.ConsumerSecret = Configuration["Authentication:Twitter:ClientSecret"]; - }); */ - - branch.UseOAuthAuthorizationServer( - - options => - { - OAuthServerAppOptions = options; - options.AuthorizeEndpointPath = new PathString(Constants.AuthorizePath.Substring(1)); - options.TokenEndpointPath = new PathString(Constants.TokenPath.Substring(1)); - options.ApplicationCanDisplayErrors = true; - options.AllowInsecureHttp = true; - options.AuthenticationScheme = OAuthDefaults.AuthenticationType; - options.TokenDataProtector = ProtectionProvider.CreateProtector("Bearer protection"); - - options.Provider = new OAuthAuthorizationServerProvider - { - OnValidateClientRedirectUri = ValidateClientRedirectUri, - OnValidateClientAuthentication = ValidateClientAuthentication, - OnGrantResourceOwnerCredentials = GrantResourceOwnerCredentials, - OnGrantClientCredentials = GrantClientCredetails - }; - - options.AuthorizationCodeProvider = new AuthenticationTokenProvider - { - OnCreate = CreateAuthenticationCode, - OnReceive = ReceiveAuthenticationCode, - }; - - options.RefreshTokenProvider = new AuthenticationTokenProvider - { - OnCreate = CreateRefreshToken, - OnReceive = ReceiveRefreshToken, - }; - - options.AutomaticAuthenticate = true; - options.AutomaticChallenge = true; - } - ); - }); - - Environment.SetEnvironmentVariable("GOOGLE_APPLICATION_CREDENTIALS", "google-secret.json"); - - } - } -} diff --git a/src/Yavsc/Startup/Startup.OAuthHelpers.cs b/src/Yavsc/Startup/Startup.OAuthHelpers.cs deleted file mode 100644 index af1cdd42..00000000 --- a/src/Yavsc/Startup/Startup.OAuthHelpers.cs +++ /dev/null @@ -1,179 +0,0 @@ -using System; -using System.Collections.Concurrent; -using System.Collections.Generic; -using System.Linq; -using System.Security.Claims; -using System.Security.Principal; -using System.Threading.Tasks; -using Microsoft.AspNet.Identity; -using Microsoft.Data.Entity; -using Microsoft.Extensions.Logging; -using OAuth.AspNet.AuthServer; -using Yavsc.Models; -using Yavsc.Models.Auth; - -namespace Yavsc -{ - public partial class Startup - { - private Client GetApplication(string clientId) - { - if (_dbContext==null) - _logger.LogError("no db!"); - Client app = _dbContext.Applications.FirstOrDefault(x => x.Id == clientId); - if (app==null) - _logger.LogError($"no app for <{clientId}>"); - return app; - } - - private readonly ConcurrentDictionary _authenticationCodes = new ConcurrentDictionary(StringComparer.Ordinal); - - private Task ValidateClientRedirectUri(OAuthValidateClientRedirectUriContext context) - { - if (context == null) throw new InvalidOperationException("context == null"); - var app = GetApplication(context.ClientId); - if (app == null) return Task.FromResult(0); - Startup._logger.LogInformation($"ValidateClientRedirectUri: Validated ({app.RedirectUri})"); - context.Validated(app.RedirectUri); - return Task.FromResult(0); - } - - private Task ValidateClientAuthentication(OAuthValidateClientAuthenticationContext context) - { - string clientId, clientSecret; - - if (context.TryGetBasicCredentials(out clientId, out clientSecret) || - context.TryGetFormCredentials(out clientId, out clientSecret)) - { - _logger.LogInformation($"ValidateClientAuthentication: Got id: ({clientId} secret: {clientSecret})"); - var client = GetApplication(clientId); - if (client==null) { - context.SetError("invalid_clientId", "Client secret is invalid."); - return Task.FromResult(null); - } else - if (client.Type == ApplicationTypes.NativeConfidential) - { - _logger.LogInformation($"NativeConfidential key"); - if (string.IsNullOrWhiteSpace(clientSecret)) - { - _logger.LogInformation($"invalid_clientId: Client secret should be sent."); - context.SetError("invalid_clientId", "Client secret should be sent."); - return Task.FromResult(null); - } - else - { - // if (client.Secret != Helper.GetHash(clientSecret)) - // TODO store a hash in db, not the pass - if (client.Secret != clientSecret) - { - context.SetError("invalid_clientId", "Client secret is invalid."); - _logger.LogInformation($"invalid_clientId: Client secret is invalid."); - return Task.FromResult(null); - } - } - } - - if (!client.Active) - { - context.SetError("invalid_clientId", "Client is inactive."); - _logger.LogInformation($"invalid_clientId: Client is inactive."); - return Task.FromResult(null); - } - - if (client != null && client.Secret == clientSecret) - { - _logger.LogInformation($"\\o/ ValidateClientAuthentication: Validated ({clientId})"); - context.Validated(); - } - else _logger.LogInformation($":'( ValidateClientAuthentication: KO ({clientId})"); - } - else _logger.LogWarning($"ValidateClientAuthentication: neither Basic nor Form credential were found"); - return Task.FromResult(0); - } - - UserManager _usermanager; - - private async Task GrantResourceOwnerCredentials(OAuthGrantResourceOwnerCredentialsContext context) - { - _logger.LogWarning($"GrantResourceOwnerCredentials task ... {context.UserName}"); - - ApplicationUser user = null; - user = _dbContext.Users.Include(u=>u.Membership).First(u=>u.UserName == context.UserName); - - if (await _usermanager.CheckPasswordAsync(user, context.Password)) - { - - var claims = new List( - context.Scope.Select(x => new Claim("urn:oauth:scope", x)) - ) - { - new Claim(ClaimTypes.NameIdentifier, user.Id), - new Claim(ClaimTypes.Email, user.Email) - }; - claims.AddRange((await _usermanager.GetRolesAsync(user)).Select( - r => new Claim(ClaimTypes.Role, r) - )); - claims.AddRange(user.Membership.Select( - m => new Claim(YavscClaimTypes.CircleMembership, m.CircleId.ToString()) - )); - ClaimsPrincipal principal = new ClaimsPrincipal( - new ClaimsIdentity( - new GenericIdentity(context.UserName, OAuthDefaults.AuthenticationType), - claims) - ); - context.HttpContext.User = principal; - context.Validated(principal); - } - - return Task.FromResult(0); - } - - private Task GrantClientCredetails(OAuthGrantClientCredentialsContext context) - { - var id = new GenericIdentity(context.ClientId, OAuthDefaults.AuthenticationType); - var claims = context.Scope.Select(x => new Claim("urn:oauth:scope", x)); - var cid = new ClaimsIdentity(id, claims); - ClaimsPrincipal principal = new ClaimsPrincipal(cid); - - context.Validated(principal); - - return Task.FromResult(0); - } - - private void CreateAuthenticationCode(AuthenticationTokenCreateContext context) - { - _logger.LogInformation("CreateAuthenticationCode"); - context.SetToken(Guid.NewGuid().ToString("n") + Guid.NewGuid().ToString("n")); - _authenticationCodes[context.Token] = context.SerializeTicket(); - } - - private void ReceiveAuthenticationCode(AuthenticationTokenReceiveContext context) - { - string value; - if (_authenticationCodes.TryRemove(context.Token, out value)) - { - context.DeserializeTicket(value); - _logger.LogInformation("ReceiveAuthenticationCode: Success"); - } - } - - private void CreateRefreshToken(AuthenticationTokenCreateContext context) - { - var uid = context.Ticket.Principal.GetUserId(); - _logger.LogInformation($"CreateRefreshToken for {uid}"); - foreach (var c in context.Ticket.Principal.Claims) - _logger.LogInformation($"| User claim: {c.Type} {c.Value}"); - - context.SetToken(context.SerializeTicket()); - } - - private void ReceiveRefreshToken(AuthenticationTokenReceiveContext context) - { - var uid = context.Ticket.Principal.GetUserId(); - _logger.LogInformation($"ReceiveRefreshToken for {uid}"); - foreach (var c in context.Ticket.Principal.Claims) - _logger.LogInformation($"| User claim: {c.Type} {c.Value}"); - context.DeserializeTicket(context.Token); - } - } -} diff --git a/src/Yavsc/Startup/Startup.SanityChecks.cs b/src/Yavsc/Startup/Startup.SanityChecks.cs index 9f44fbd3..4e13572f 100644 --- a/src/Yavsc/Startup/Startup.SanityChecks.cs +++ b/src/Yavsc/Startup/Startup.SanityChecks.cs @@ -1,10 +1,5 @@ -using System; -using System.IO; -using Microsoft.AspNet.Builder; -using Microsoft.AspNet.Hosting; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Logging; +using Microsoft.AspNetCore.Hosting; namespace Yavsc { @@ -14,7 +9,7 @@ namespace Yavsc public partial class Startup { - public void CheckApp(IHostingEnvironment env, + public void CheckApp(Microsoft.AspNetCore.Hosting.IHostingEnvironment env, ILoggerFactory loggerFactory) { diff --git a/src/Yavsc/Startup/Startup.WebSockets.cs b/src/Yavsc/Startup/Startup.WebSockets.cs index f3c6333b..5b45e32e 100644 --- a/src/Yavsc/Startup/Startup.WebSockets.cs +++ b/src/Yavsc/Startup/Startup.WebSockets.cs @@ -1,12 +1,3 @@ -using System; -using System.Net.WebSockets; -using System.Threading; -using System.Threading.Tasks; -using Microsoft.AspNet.Builder; -using Microsoft.AspNet.Hosting; -using Microsoft.AspNet.Http; -using Microsoft.AspNet.WebSockets.Server; - namespace Yavsc { public partial class Startup @@ -16,12 +7,10 @@ namespace Yavsc var webSocketOptions = new WebSocketOptions() { KeepAliveInterval = TimeSpan.FromSeconds(30), - ReceiveBufferSize = Constants.WebSocketsMaxBufLen, - ReplaceFeature = false + ReceiveBufferSize = Constants.WebSocketsMaxBufLen }; app.UseWebSockets(webSocketOptions); - app.UseSignalR(PathString.FromUriComponent(Constants.SignalRPath)); } } diff --git a/src/Yavsc/Startup/Startup.Workflow.cs b/src/Yavsc/Startup/Startup.Workflow.cs index 75456e8f..39857d28 100644 --- a/src/Yavsc/Startup/Startup.Workflow.cs +++ b/src/Yavsc/Startup/Startup.Workflow.cs @@ -1,12 +1,6 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using Microsoft.AspNet.Builder; -using Microsoft.Extensions.Logging; - namespace Yavsc { - using Microsoft.Data.Entity; + using Microsoft.EntityFrameworkCore; using Models; using Yavsc.Abstract.Workflow; using Yavsc.Billing; @@ -64,7 +58,7 @@ namespace Yavsc // TODO swith () case {} if (typeof(IQueryable).IsAssignableFrom(propinfo.PropertyType)) {// double-bingo - _logger.LogVerbose($"Pro: {propinfo.Name}"); + _logger.LogTrace($"Pro: {propinfo.Name}"); BillingService.UserSettings.Add(propinfo); } else diff --git a/src/Yavsc/Startup/Startup.cs b/src/Yavsc/Startup/Startup.cs index ac1cb27d..1da67699 100755 --- a/src/Yavsc/Startup/Startup.cs +++ b/src/Yavsc/Startup/Startup.cs @@ -1,46 +1,27 @@ -using System; using System.Globalization; -using System.IO; using System.Reflection; -using System.Web.Optimization; -using Microsoft.AspNet.Authentication; -using Microsoft.AspNet.Authorization; -using Microsoft.AspNet.Builder; -using Microsoft.AspNet.Diagnostics; -using Microsoft.AspNet.Hosting; -using Microsoft.AspNet.Localization; -using Microsoft.AspNet.Mvc; -using Microsoft.AspNet.Mvc.Filters; -using Microsoft.AspNet.Mvc.Razor; -using Microsoft.Data.Entity; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.OptionsModel; -using Microsoft.Extensions.PlatformAbstractions; +using Microsoft.AspNetCore.Authentication; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Localization; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.Razor; using Microsoft.Net.Http.Headers; using Newtonsoft.Json; +using System.Net; +using Google.Apis.Util.Store; +using Microsoft.AspNetCore.Identity; +using Microsoft.Extensions.Localization; +using Yavsc.Helpers; +using static System.Environment; namespace Yavsc { - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Security.Claims; - using Formatters; - using Google.Apis.Util.Store; - using Microsoft.AspNet.Http; - using Microsoft.AspNet.Identity; - using Microsoft.AspNet.SignalR; - using Microsoft.Extensions.Localization; - using Microsoft.Extensions.Logging; + using Microsoft.AspNetCore.Mvc.Authorization; + using Microsoft.EntityFrameworkCore; + using Microsoft.Extensions.Options; using Models; using Services; - using Yavsc.Abstract.FileSystem; - using Yavsc.AuthorizationHandlers; - using Yavsc.Helpers; - using Yavsc.Models.Messaging; - using static System.Environment; public partial class Startup { @@ -56,13 +37,9 @@ namespace Yavsc public static PayPalSettings PayPalSettings { get; private set; } private static ILogger _logger; - /// - /// generating reset password and confirmation tokens - /// - public IUserTokenProvider UserTokenProvider { get; set; } - public Startup(IHostingEnvironment env, IApplicationEnvironment appEnv) + public Startup( IWebHostEnvironment env) { AppDomain.CurrentDomain.UnhandledException += OnUnHandledException; @@ -70,20 +47,12 @@ namespace Yavsc var prodtag = env.IsProduction() ? "P" : ""; var stagetag = env.IsStaging() ? "S" : ""; - HostingFullName = $"{appEnv.RuntimeFramework.FullName} [{env.EnvironmentName}:{prodtag}{devtag}{stagetag}]"; + HostingFullName = $"{env.EnvironmentName} [{prodtag}/{devtag}/{stagetag}]"; // Set up configuration sources. var builder = new ConfigurationBuilder() .AddJsonFile("appsettings.json") .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true); - if (env.IsDevelopment()) - { - // For more details on using the user secret store see http://go.microsoft.com/fwlink/?LinkID=532709 - builder.AddUserSecrets(); - BundleTable.EnableOptimizations = false; - } - - BundleConfig.RegisterBundles(BundleTable.Bundles); builder.AddEnvironmentVariables(); Configuration = builder.Build(); @@ -175,16 +144,10 @@ namespace Yavsc }; }); - // DataProtection - ConfigureProtectionServices(services); - - // Add framework services. - services.AddEntityFramework() - .AddNpgsql() + services.AddEntityFrameworkNpgsql() .AddDbContext(); - ConfigureOAuthServices(services); services.AddCors( @@ -197,8 +160,6 @@ namespace Yavsc } ); - // Add memory cache services - services.AddCaching(); // Add session related services. services.AddSession(); @@ -223,7 +184,7 @@ namespace Yavsc options.AddPolicy("Authenticated", policy => policy.RequireAuthenticatedUser()); }); - services.AddSingleton(); + /* FIXME services.AddSingleton(); services.AddSingleton(); services.AddSingleton(); services.AddSingleton(); @@ -231,7 +192,8 @@ namespace Yavsc services.AddSingleton(); services.AddSingleton(); services.AddSingleton(); - services.AddSingleton(); + services.AddSingleton(); */ + services.AddSingleton(); services.AddSingleton(); services.AddSingleton(); @@ -245,7 +207,6 @@ namespace Yavsc config.Filters.Add(new ProducesAttribute("application/json")); // config.ModelBinders.Insert(0,new MyDateTimeModelBinder()); // config.ModelBinders.Insert(0,new MyDecimalModelBinder()); - config.OutputFormatters.Add(new PdfFormatter()); }).AddFormatterMappings( config => config.SetMediaTypeMappingForFormat("text/pdf", new MediaTypeHeaderValue("text/pdf")) @@ -263,7 +224,7 @@ namespace Yavsc // Inject ticket formatting services.AddTransient(typeof(ISecureDataFormat<>), typeof(SecureDataFormat<>)); - services.AddTransient, Microsoft.AspNet.Authentication.SecureDataFormat>(); + services.AddTransient, SecureDataFormat>(); services.AddTransient, TicketDataFormat>(); // Add application services. @@ -281,11 +242,13 @@ namespace Yavsc }); } static ApplicationDbContext _dbContext; + private UserManager _usermanager; + public static IServiceProvider Services { get; private set; } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure( - IApplicationBuilder app, IHostingEnvironment env, + IApplicationBuilder app, Microsoft.AspNetCore.Hosting.IHostingEnvironment env, ApplicationDbContext dbContext, IOptions siteSettings, IOptions localizationOptions, IAuthorizationService authorizationService, @@ -322,47 +285,12 @@ namespace Yavsc if (!di.Exists) di.Create(); } - loggerFactory.AddConsole(Configuration.GetSection("Logging")); - loggerFactory.AddDebug(); _logger = loggerFactory.CreateLogger(); app.UseStatusCodePagesWithReExecute("/Home/Status/{0}"); if (env.IsDevelopment()) { - var logenvvar = Environment.GetEnvironmentVariable("ASPNET_LOG_LEVEL"); - if (logenvvar != null) - switch (logenvvar) - { - case "info": - loggerFactory.MinimumLevel = LogLevel.Information; - break; - case "warn": - loggerFactory.MinimumLevel = LogLevel.Warning; - break; - case "err": - loggerFactory.MinimumLevel = LogLevel.Error; - break; - case "debug": - default: - loggerFactory.MinimumLevel = LogLevel.Debug; - break; - } - - - app.UseRuntimeInfoPage(); - var epo = new ErrorPageOptions - { - SourceCodeLineCount = 20 - }; - app.UseDeveloperExceptionPage(epo); - app.UseDatabaseErrorPage( - x => - { - x.EnableAll(); - x.ShowExceptionDetails = true; - } - ); + app.UseDeveloperExceptionPage(); app.UseWelcomePage("/welcome"); - } else { @@ -393,36 +321,49 @@ namespace Yavsc // then, fix it. ServicePointManager.SecurityProtocol = (SecurityProtocolType)0xC00; // Tls12, required by PayPal - app.UseIISPlatformHandler(options => - { - options.AuthenticationDescriptions.Clear(); - options.AutomaticAuthentication = false; - }); app.UseSession(); - ConfigureOAuthApp(app); ConfigureFileServerApp(app, SiteSetup, env, authorizationService); - app.UseRequestLocalization(localizationOptions.Value, (RequestCulture)new RequestCulture((string)"en-US")); + app.UseRequestLocalization(); ConfigureWorkflow(); ConfigureWebSocketsApp(app); - app.UseMvc(routes => - { - routes.MapRoute( - name: "default", - template: "{controller=Home}/{action=Index}/{id?}"); - }); + _logger.LogInformation("LocalApplicationData: " + Environment.GetFolderPath(SpecialFolder.LocalApplicationData, SpecialFolderOption.DoNotVerify)); CheckApp(env, loggerFactory); } // Entry point for the application. - public static void Main(string[] args) => Microsoft.AspNet.Hosting.WebApplication.Run(args); - } + public static void Main(string[] args) { + var builder = WebApplication.CreateBuilder(args); + builder.Services.AddSignalR(); + var app = builder.Build(); + + // Configure the HTTP request pipeline. + if (!app.Environment.IsDevelopment()) + { + app.UseExceptionHandler("/Error"); + // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. + app.UseHsts(); + } + app.UseHttpsRedirection(); + app.UseStaticFiles(); + + app.UseRouting(); + + app.UseAuthorization(); + + app.MapRazorPages(); + app.MapHub("/chatHub"); + + app.Run(); + + } + } } // diff --git a/src/Yavsc/Startup/UserTokenProvider.cs b/src/Yavsc/Startup/UserTokenProvider.cs new file mode 100644 index 00000000..6a17abee --- /dev/null +++ b/src/Yavsc/Startup/UserTokenProvider.cs @@ -0,0 +1,6 @@ +namespace Yavsc +{ + internal class UserTokenProvider + { + } +} diff --git a/src/Yavsc/Startup/YaSendFileMiddleware.cs b/src/Yavsc/Startup/YaSendFileMiddleware.cs index 467e5de5..35ca4faa 100644 --- a/src/Yavsc/Startup/YaSendFileMiddleware.cs +++ b/src/Yavsc/Startup/YaSendFileMiddleware.cs @@ -1,8 +1,8 @@ using System; using System.Threading.Tasks; -using Microsoft.AspNet.Builder; -using Microsoft.AspNet.Http; -using Microsoft.AspNet.Http.Features; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Http.Features; using Microsoft.Extensions.Logging; namespace Yavsc @@ -43,9 +43,9 @@ namespace Yavsc { if (context.Response.StatusCode < 400 || context.Response.StatusCode >= 600 ) { - if (context.Features.Get() == null) + if (context.Features.Get() == null) { - context.Features.Set((IHttpSendFileFeature)new YaSendFileWrapper(context.Response.Body, _logger)); + context.Features.Set(new YaSendFileWrapper(context.Response.Body, _logger)); } } return _next(context); diff --git a/src/Yavsc/ViewComponents/BillViewComponent.cs b/src/Yavsc/ViewComponents/BillViewComponent.cs index 5fb0c7da..9f29e0bc 100644 --- a/src/Yavsc/ViewComponents/BillViewComponent.cs +++ b/src/Yavsc/ViewComponents/BillViewComponent.cs @@ -1,16 +1,13 @@ -using System.IO; -using System.Threading.Tasks; -using Microsoft.AspNet.Mvc; -using Microsoft.Data.Entity; + +using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Localization; -using Microsoft.Extensions.Logging; -using Yavsc.Abstract.FileSystem; using Yavsc.Billing; using Yavsc.Helpers; using Yavsc.Models; using Yavsc.ViewModels; using Yavsc.ViewModels.Gen; using Yavsc.Services; +using Microsoft.EntityFrameworkCore; namespace Yavsc.ViewComponents { @@ -86,9 +83,9 @@ namespace Yavsc.ViewComponents BaseFileName = billable.GetFileBaseName(billing) }; if (genrtrData.GenerateEstimatePdf()) { - return Json(new { Generated = genrtrData.BaseFileName+".pdf" }); + return this.View(new { Generated = genrtrData.BaseFileName+".pdf" }); } else { - return Json(new { Error = genrtrData.GenerationErrorMessage } ); + return View(new { Error = genrtrData.GenerationErrorMessage } ); } } ViewBag.BillFileInfo = billable.GetBillInfo(billing); diff --git a/src/Yavsc/ViewComponents/BlogIndexViewComponent.cs b/src/Yavsc/ViewComponents/BlogIndexViewComponent.cs index 04901b64..a8b55058 100644 --- a/src/Yavsc/ViewComponents/BlogIndexViewComponent.cs +++ b/src/Yavsc/ViewComponents/BlogIndexViewComponent.cs @@ -1,12 +1,7 @@ -using System.Threading.Tasks; -using Microsoft.AspNet.Mvc; -using Microsoft.AspNet.Identity; -using Microsoft.Extensions.Logging; -using Microsoft.AspNet.Authorization; -using Microsoft.Extensions.OptionsModel; + +using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; using Yavsc.Models; -using Microsoft.Data.Entity; -using System.Linq; using Yavsc.Models.Blog; namespace Yavsc.ViewComponents diff --git a/src/Yavsc/ViewComponents/CalendarViewComponent.cs b/src/Yavsc/ViewComponents/CalendarViewComponent.cs index 9ebe282c..144ce30f 100644 --- a/src/Yavsc/ViewComponents/CalendarViewComponent.cs +++ b/src/Yavsc/ViewComponents/CalendarViewComponent.cs @@ -1,6 +1,6 @@ using System; using System.Threading.Tasks; -using Microsoft.AspNet.Mvc; +using Microsoft.AspNetCore.Mvc; using Yavsc.Models; using Yavsc.Services; diff --git a/src/Yavsc/ViewComponents/CirclesControlViewComponent.cs b/src/Yavsc/ViewComponents/CirclesControlViewComponent.cs index 6f7f549e..117b60d7 100644 --- a/src/Yavsc/ViewComponents/CirclesControlViewComponent.cs +++ b/src/Yavsc/ViewComponents/CirclesControlViewComponent.cs @@ -1,6 +1,6 @@ using System.Linq; -using Microsoft.AspNet.Mvc; -using Microsoft.AspNet.Mvc.Rendering; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.Rendering; namespace Yavsc.ViewComponents { diff --git a/src/Yavsc/ViewComponents/CommentViewComponent.cs b/src/Yavsc/ViewComponents/CommentViewComponent.cs index c3e77731..619811cb 100644 --- a/src/Yavsc/ViewComponents/CommentViewComponent.cs +++ b/src/Yavsc/ViewComponents/CommentViewComponent.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNet.Mvc; +using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Localization; using Yavsc.Models.Blog; diff --git a/src/Yavsc/ViewComponents/DirectoryViewComponent.cs b/src/Yavsc/ViewComponents/DirectoryViewComponent.cs index 676ff3d6..82099a14 100644 --- a/src/Yavsc/ViewComponents/DirectoryViewComponent.cs +++ b/src/Yavsc/ViewComponents/DirectoryViewComponent.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNet.Mvc; +using Microsoft.AspNetCore.Mvc; using System.Threading.Tasks; using Yavsc.Helpers; using Yavsc.ViewModels.UserFiles; @@ -18,4 +18,4 @@ namespace Yavsc.ViewComponents return result; } } -} \ No newline at end of file +} diff --git a/src/Yavsc/ViewComponents/PayPalButtonComponent.cs b/src/Yavsc/ViewComponents/PayPalButtonComponent.cs index 2f207af4..d9694878 100644 --- a/src/Yavsc/ViewComponents/PayPalButtonComponent.cs +++ b/src/Yavsc/ViewComponents/PayPalButtonComponent.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNet.Mvc; +using Microsoft.AspNetCore.Mvc; using Yavsc.Helpers; using Yavsc.Models.Billing; diff --git a/src/Yavsc/ViewComponents/TaggerComponent.cs b/src/Yavsc/ViewComponents/TaggerComponent.cs index da57ca5f..64579834 100644 --- a/src/Yavsc/ViewComponents/TaggerComponent.cs +++ b/src/Yavsc/ViewComponents/TaggerComponent.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNet.Mvc; +using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Localization; using Microsoft.Extensions.Logging; using Yavsc.Interfaces; diff --git a/src/Yavsc/ViewModels/Account/LoginViewModel.cs b/src/Yavsc/ViewModels/Account/LoginViewModel.cs new file mode 100644 index 00000000..39e96f40 --- /dev/null +++ b/src/Yavsc/ViewModels/Account/LoginViewModel.cs @@ -0,0 +1,15 @@ +namespace Yavsc.ViewModels.Account +{ + public class LoginViewModel + { + public string UserName { get; set; } + + public string Password { get; set; } + + public bool RememberMe { get; set; } + + public string ReturnUrl { get; set; } + + public string Provider { get; set; } + } +} diff --git a/src/Yavsc/ViewModels/Account/SendCodeViewModel.cs b/src/Yavsc/ViewModels/Account/SendCodeViewModel.cs index ae1eb469..a10bda89 100644 --- a/src/Yavsc/ViewModels/Account/SendCodeViewModel.cs +++ b/src/Yavsc/ViewModels/Account/SendCodeViewModel.cs @@ -1,5 +1,5 @@ using System.Collections.Generic; -using Microsoft.AspNet.Mvc.Rendering; +using Microsoft.AspNetCore.Mvc.Rendering; namespace Yavsc.ViewModels.Account { diff --git a/src/Yavsc/ViewModels/Auth/EditRequirement.cs b/src/Yavsc/ViewModels/Auth/EditRequirement.cs index 40e0e5f5..f6693943 100644 --- a/src/Yavsc/ViewModels/Auth/EditRequirement.cs +++ b/src/Yavsc/ViewModels/Auth/EditRequirement.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNet.Authorization; +using Microsoft.AspNetCore.Authorization; namespace Yavsc.ViewModels.Auth { @@ -8,4 +8,4 @@ namespace Yavsc.ViewModels.Auth { } } -} \ No newline at end of file +} diff --git a/src/Yavsc/ViewModels/Auth/FileSpotInfo.cs b/src/Yavsc/ViewModels/Auth/FileSpotInfo.cs index 677bfccd..78141e98 100644 --- a/src/Yavsc/ViewModels/Auth/FileSpotInfo.cs +++ b/src/Yavsc/ViewModels/Auth/FileSpotInfo.cs @@ -1,6 +1,6 @@ using System.IO; -using Microsoft.AspNet.Authorization; +using Microsoft.AspNetCore.Authorization; using Yavsc.Models.Blog; namespace Yavsc.ViewModels.Auth { @@ -22,4 +22,4 @@ namespace Yavsc.ViewModels.Auth { -} \ No newline at end of file +} diff --git a/src/Yavsc/ViewModels/Auth/ModerationRequirement.cs b/src/Yavsc/ViewModels/Auth/ModerationRequirement.cs index 18a98c26..038b77a0 100644 --- a/src/Yavsc/ViewModels/Auth/ModerationRequirement.cs +++ b/src/Yavsc/ViewModels/Auth/ModerationRequirement.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNet.Authorization; +using Microsoft.AspNetCore.Authorization; namespace Yavsc.ViewModels.Auth { diff --git a/src/Yavsc/ViewModels/Auth/PrivateChatEntryRequirement.cs b/src/Yavsc/ViewModels/Auth/PrivateChatEntryRequirement.cs index c3c5f92a..197e27c9 100644 --- a/src/Yavsc/ViewModels/Auth/PrivateChatEntryRequirement.cs +++ b/src/Yavsc/ViewModels/Auth/PrivateChatEntryRequirement.cs @@ -1,8 +1,8 @@ -using Microsoft.AspNet.Authorization; +using Microsoft.AspNetCore.Authorization; namespace Yavsc.ViewModels.Auth { public class PrivateChatEntryRequirement : IAuthorizationRequirement { } -} \ No newline at end of file +} diff --git a/src/Yavsc/ViewModels/Auth/ViewFileContext.cs b/src/Yavsc/ViewModels/Auth/ViewFileContext.cs index 3f8a3d09..c80fc420 100644 --- a/src/Yavsc/ViewModels/Auth/ViewFileContext.cs +++ b/src/Yavsc/ViewModels/Auth/ViewFileContext.cs @@ -1,4 +1,5 @@ -using Microsoft.AspNet.FileProviders; + +using Microsoft.Extensions.FileProviders; namespace Yavsc.ViewModels.Auth { @@ -8,4 +9,4 @@ namespace Yavsc.ViewModels.Auth public IFileInfo File { get; set; } public string Path { get; set; } } -} \ No newline at end of file +} diff --git a/src/Yavsc/ViewModels/Auth/ViewRequirement.cs b/src/Yavsc/ViewModels/Auth/ViewRequirement.cs index e169bb11..da11800e 100644 --- a/src/Yavsc/ViewModels/Auth/ViewRequirement.cs +++ b/src/Yavsc/ViewModels/Auth/ViewRequirement.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNet.Authorization; +using Microsoft.AspNetCore.Authorization; namespace Yavsc.ViewModels.Auth { @@ -8,4 +8,4 @@ namespace Yavsc.ViewModels.Auth { } } -} \ No newline at end of file +} diff --git a/src/Yavsc/ViewModels/Gen/PdfGenerationViewModel.cs b/src/Yavsc/ViewModels/Gen/PdfGenerationViewModel.cs index 0e0cc0e3..883199f0 100644 --- a/src/Yavsc/ViewModels/Gen/PdfGenerationViewModel.cs +++ b/src/Yavsc/ViewModels/Gen/PdfGenerationViewModel.cs @@ -1,5 +1,6 @@ using System.ComponentModel.DataAnnotations; -using Microsoft.AspNet.Mvc.Rendering; +using Microsoft.AspNetCore.Html; +using Microsoft.AspNetCore.Mvc.Rendering; using Yavsc.Attributes.Validation; namespace Yavsc.ViewModels.Gen @@ -17,4 +18,4 @@ namespace Yavsc.ViewModels.Gen public HtmlString GenerationErrorMessage { get; set; } public string Temp { get; set; } } -} \ No newline at end of file +} diff --git a/src/Yavsc/ViewModels/Manage/ConfigureTwoFactorViewModel.cs b/src/Yavsc/ViewModels/Manage/ConfigureTwoFactorViewModel.cs index c62aa8df..685d11be 100644 --- a/src/Yavsc/ViewModels/Manage/ConfigureTwoFactorViewModel.cs +++ b/src/Yavsc/ViewModels/Manage/ConfigureTwoFactorViewModel.cs @@ -1,5 +1,5 @@ using System.Collections.Generic; -using Microsoft.AspNet.Mvc.Rendering; +using Microsoft.AspNetCore.Mvc.Rendering; namespace Yavsc.ViewModels.Manage { diff --git a/src/Yavsc/ViewModels/Manage/IndexViewModel.cs b/src/Yavsc/ViewModels/Manage/IndexViewModel.cs index 02c39ff5..fadb7362 100644 --- a/src/Yavsc/ViewModels/Manage/IndexViewModel.cs +++ b/src/Yavsc/ViewModels/Manage/IndexViewModel.cs @@ -1,5 +1,5 @@ using System.Collections.Generic; -using Microsoft.AspNet.Identity; +using Microsoft.AspNetCore.Identity; namespace Yavsc.ViewModels.Manage { diff --git a/src/Yavsc/ViewModels/Manage/ManageLoginsViewModel.cs b/src/Yavsc/ViewModels/Manage/ManageLoginsViewModel.cs index c536610b..d29107c3 100644 --- a/src/Yavsc/ViewModels/Manage/ManageLoginsViewModel.cs +++ b/src/Yavsc/ViewModels/Manage/ManageLoginsViewModel.cs @@ -1,13 +1,10 @@ using System.Collections.Generic; -using Microsoft.AspNet.Http.Authentication; -using Microsoft.AspNet.Identity; +using Microsoft.AspNetCore.Identity; namespace Yavsc.ViewModels.Manage { public class ManageLoginsViewModel { public IList CurrentLogins { get; set; } - - public IList OtherLogins { get; set; } } } diff --git a/src/Yavsc/Views/Account/legacyLogin.cshtml b/src/Yavsc/Views/Account/legacyLogin.cshtml index 8337db4b..e09953e0 100755 --- a/src/Yavsc/Views/Account/legacyLogin.cshtml +++ b/src/Yavsc/Views/Account/legacyLogin.cshtml @@ -1,7 +1,5 @@ -@using Microsoft.AspNet.Http.Authentication -@using Yavsc.ViewModels.Account -@model LoginViewModel +@model Yavsc.ViewModels.Account.LoginViewModel @{ ViewData["Title"] = SR["Log in"]; } diff --git a/src/Yavsc/Views/Bug/DeleteAllLike.cshtml b/src/Yavsc/Views/Bug/DeleteAllLike.cshtml index 8c6d4239..06dba4d0 100644 --- a/src/Yavsc/Views/Bug/DeleteAllLike.cshtml +++ b/src/Yavsc/Views/Bug/DeleteAllLike.cshtml @@ -1,5 +1,4 @@ @model IEnumerable -@inject IStringLocalizer SRR @{ ViewData["Title"] = @SR["DeleteAllLike"]; @@ -41,7 +40,7 @@ - @SRR[typeof(Yavsc.Models.IT.Fixing.BugStatus).GetEnumNames()[(int)item.Status]] + @SR[typeof(Yavsc.Models.IT.Fixing.BugStatus).GetEnumNames()[(int)item.Status]] @SR["Edit"] | diff --git a/src/Yavsc/Views/Bug/Details.cshtml b/src/Yavsc/Views/Bug/Details.cshtml index d3c4a5d1..f835f4d8 100644 --- a/src/Yavsc/Views/Bug/Details.cshtml +++ b/src/Yavsc/Views/Bug/Details.cshtml @@ -1,5 +1,4 @@ @model Yavsc.Models.IT.Fixing.Bug -@inject IStringLocalizer SRR @{ ViewData["Title"] = @SR["Details"]; @@ -27,7 +26,7 @@ @SR["Status"]
- @SRR[typeof(Yavsc.Models.IT.Fixing.BugStatus).GetEnumNames()[(int)Model.Status]] + @SR[typeof(Yavsc.Models.IT.Fixing.BugStatus).GetEnumNames()[(int)Model.Status]]
diff --git a/src/Yavsc/Views/Bug/Index.cshtml b/src/Yavsc/Views/Bug/Index.cshtml index 978f63c1..a7128bf8 100644 --- a/src/Yavsc/Views/Bug/Index.cshtml +++ b/src/Yavsc/Views/Bug/Index.cshtml @@ -1,5 +1,4 @@ @model IEnumerable -@inject IStringLocalizer SRR @{ ViewData["Title"] = @SR["Index"]; @@ -41,7 +40,7 @@ - @SRR[typeof(Yavsc.Models.IT.Fixing.BugStatus).GetEnumNames()[(int)item.Status]] + @SR[typeof(Yavsc.Models.IT.Fixing.BugStatus).GetEnumNames()[(int)item.Status]] @SR["Edit"] | diff --git a/src/Yavsc/Views/Client/Create.cshtml b/src/Yavsc/Views/Client/Create.cshtml deleted file mode 100644 index 2302b339..00000000 --- a/src/Yavsc/Views/Client/Create.cshtml +++ /dev/null @@ -1,75 +0,0 @@ -@model Client - -@{ - ViewData["Title"] = @SR["Create"]; -} - -

@SR["Create"]

- -
-
-

Client

-
-
-
-
-
- - -
-
-
-
- -
- - -
-
-
- -
- - -
-
-
- -
- - -
-
-
- -
- - -
-
-
- -
- - -
-
-
- -
- @Html.DropDownList("Type") - -
-
-
-
- -
-
-
-
- - - diff --git a/src/Yavsc/Views/Client/Delete.cshtml b/src/Yavsc/Views/Client/Delete.cshtml deleted file mode 100644 index 0ce7409f..00000000 --- a/src/Yavsc/Views/Client/Delete.cshtml +++ /dev/null @@ -1,64 +0,0 @@ -@model Client - -@{ - ViewData["Title"] = @SR["Delete"]; -} - -

@SR["Delete"]

- -

@SR["AreYourSureYouWantToDeleteThis"]

-
-

Client

-
-
-
- @Html.DisplayNameFor(model => model.Active) -
-
- @Html.DisplayFor(model => model.Active) -
-
- @Html.DisplayNameFor(model => model.DisplayName) -
-
- @Html.DisplayFor(model => model.DisplayName) -
-
- @Html.DisplayNameFor(model => model.LogoutRedirectUri) -
-
- @Html.DisplayFor(model => model.LogoutRedirectUri) -
-
- @Html.DisplayNameFor(model => model.RedirectUri) -
-
- @Html.DisplayFor(model => model.RedirectUri) -
-
- @Html.DisplayNameFor(model => model.RefreshTokenLifeTime) -
-
- @Html.DisplayFor(model => model.RefreshTokenLifeTime) -
-
- @Html.DisplayNameFor(model => model.Secret) -
-
- @Html.DisplayFor(model => model.Secret) -
-
- @Html.DisplayNameFor(model => model.Type) -
-
- @Html.DisplayFor(model => model.Type) -
-
- -
- -
-
diff --git a/src/Yavsc/Views/Client/Details.cshtml b/src/Yavsc/Views/Client/Details.cshtml deleted file mode 100644 index 160add64..00000000 --- a/src/Yavsc/Views/Client/Details.cshtml +++ /dev/null @@ -1,66 +0,0 @@ -@model Client - -@{ - ViewData["Title"] = @SR["Details"]; -} - -

@SR["Details"]

- -
-

Client

-
-
-
- @Html.DisplayNameFor(model => model.Id) -
-
- @Html.DisplayFor(model => model.Id) -
-
- @Html.DisplayNameFor(model => model.Active) -
-
- @Html.DisplayFor(model => model.Active) -
-
- @Html.DisplayNameFor(model => model.DisplayName) -
-
- @Html.DisplayFor(model => model.DisplayName) -
-
- @Html.DisplayNameFor(model => model.LogoutRedirectUri) -
-
- @Html.DisplayFor(model => model.LogoutRedirectUri) -
-
- @Html.DisplayNameFor(model => model.RedirectUri) -
-
- @Html.DisplayFor(model => model.RedirectUri) -
-
- @Html.DisplayNameFor(model => model.RefreshTokenLifeTime) -
-
- @Html.DisplayFor(model => model.RefreshTokenLifeTime) -
-
- @Html.DisplayNameFor(model => model.Secret) -
-
- @Html.DisplayFor(model => model.Secret) -
-
- @Html.DisplayNameFor(model => model.Type) -
-
- @Html.DisplayFor(model => model.Type) -
-
-
-

- @SR["Edit"] | - @SR["Back to List"] -

diff --git a/src/Yavsc/Views/Client/Edit.cshtml b/src/Yavsc/Views/Client/Edit.cshtml deleted file mode 100644 index 3857a310..00000000 --- a/src/Yavsc/Views/Client/Edit.cshtml +++ /dev/null @@ -1,76 +0,0 @@ -@model Client - -@{ - ViewData["Title"] = "Edit"; -} - -

@SR["Edit"]

- -
-
-

Client

-
-
- -
-
-
- - -
-
-
-
- -
- - -
-
-
- -
- - -
-
-
- -
- - -
-
-
- -
- - -
-
-
- -
- - -
-
-
- -
- @Html.DropDownList("Type") - -
-
-
-
- -
-
-
-
- - - diff --git a/src/Yavsc/Views/Client/Index.cshtml b/src/Yavsc/Views/Client/Index.cshtml deleted file mode 100644 index be0e53e2..00000000 --- a/src/Yavsc/Views/Client/Index.cshtml +++ /dev/null @@ -1,68 +0,0 @@ -@model IEnumerable - -@{ - ViewData["Title"] = @SR["Index"]; -} - -

@SR["Index"]

- -

- @SR["Create New"] -

- - - - - - - - - - - - -@foreach (var item in Model) { - - - - - - - - - - -} -
- @Html.DisplayNameFor(model => model.Active) - - @Html.DisplayNameFor(model => model.DisplayName) - - @Html.DisplayNameFor(model => model.LogoutRedirectUri) - - @Html.DisplayNameFor(model => model.RedirectUri) - - @Html.DisplayNameFor(model => model.RefreshTokenLifeTime) - - @Html.DisplayNameFor(model => model.Secret) - - @Html.DisplayNameFor(model => model.Type) -
- @Html.DisplayFor(modelItem => item.Active) - - @Html.DisplayFor(modelItem => item.DisplayName) - - @Html.DisplayFor(modelItem => item.LogoutRedirectUri) - - @Html.DisplayFor(modelItem => item.RedirectUri) - - @Html.DisplayFor(modelItem => item.RefreshTokenLifeTime) - - @Html.DisplayFor(modelItem => item.Secret) - - @Html.DisplayFor(modelItem => item.Type) - - Edit | - Details | - Delete -
diff --git a/src/Yavsc/Views/Command/BookHaircutStar.cshtml b/src/Yavsc/Views/Command/BookHaircutStar.cshtml index 1c04e18d..7ddf75d1 100644 --- a/src/Yavsc/Views/Command/BookHaircutStar.cshtml +++ b/src/Yavsc/Views/Command/BookHaircutStar.cshtml @@ -1,7 +1,6 @@ -@model HairPrestationQuery + @{ ViewData["Title"] = "Proposition de rendez-vous "+ -@SR["to"]+" "+ Model.PerformerProfile.Performer.UserName -+" ["+SR[ViewBag.Activity.Code]+"]"; } +@SR["to"]+" " ["+SR[ViewBag.Activity.Code]+"]"; } diff --git a/src/Yavsc/Views/Devices/Delete.cshtml b/src/Yavsc/Views/Devices/Delete.cshtml index 406986cc..89e88a45 100644 --- a/src/Yavsc/Views/Devices/Delete.cshtml +++ b/src/Yavsc/Views/Devices/Delete.cshtml @@ -1,4 +1,4 @@ -@model Yavsc.Models.Identity.GoogleCloudMobileDeclaration +@model Yavsc.Models.Identity.DeviceDeclaration @{ ViewData["Title"] = @SR["Delete"]; @@ -8,7 +8,7 @@

@SR["AreYourSureYouWantToDeleteThis"]

-

GoogleCloudMobileDeclaration

+

DeviceDeclaration


diff --git a/src/Yavsc/Views/Devices/Details.cshtml b/src/Yavsc/Views/Devices/Details.cshtml index 23599039..fd0ecd61 100644 --- a/src/Yavsc/Views/Devices/Details.cshtml +++ b/src/Yavsc/Views/Devices/Details.cshtml @@ -1,4 +1,4 @@ -@model Yavsc.Models.Identity.GoogleCloudMobileDeclaration +@model Yavsc.Models.Identity.DeviceDeclaration @{ ViewData["Title"] = @SR["Details"]; @@ -7,7 +7,7 @@

@SR["Details"]

-

GoogleCloudMobileDeclaration

+

DeviceDeclaration


diff --git a/src/Yavsc/Views/Do/Yavsc.Models.Booking.MusicianSettingsEditor.fr.cshtml b/src/Yavsc/Views/Do/Yavsc.Models.Booking.MusicianSettingsEditor.fr.cshtml index b7b702f0..5e24f859 100644 --- a/src/Yavsc/Views/Do/Yavsc.Models.Booking.MusicianSettingsEditor.fr.cshtml +++ b/src/Yavsc/Views/Do/Yavsc.Models.Booking.MusicianSettingsEditor.fr.cshtml @@ -1,4 +1,4 @@ -@model MusicianSettings +@model Instrumentation @{ ViewBag.YetAvailableInstruments = _context.Instrument.Where(i=> !_context.MusicianSettings.Any(s=>s.UserId==id && s.Instrumentation.Any(j=>j.Id == i.Id))) .Select(k=>new SelectListItem { Text = k.Name }); @@ -20,4 +20,4 @@ - \ No newline at end of file + diff --git a/src/Yavsc/Views/Home/Index.cshtml b/src/Yavsc/Views/Home/Index.cshtml old mode 100755 new mode 100644 index ddb63b37..d2d19bdf --- a/src/Yavsc/Views/Home/Index.cshtml +++ b/src/Yavsc/Views/Home/Index.cshtml @@ -1,103 +1,8 @@ -@model IEnumerable - -@{ - ViewData["Title"] = @SR["Page d'accueil"]; - int i=0; - bool multipleact = Model.Count()>1; -} -@section scripts { - +@{ + ViewData["Title"] = "Home Page"; } -@section subbanner { - - - - - - - diff --git a/src/Yavsc/Views/MyFSRules/Create.cshtml b/src/Yavsc/Views/MyFSRules/Create.cshtml deleted file mode 100644 index 56f3ec11..00000000 --- a/src/Yavsc/Views/MyFSRules/Create.cshtml +++ /dev/null @@ -1,43 +0,0 @@ -@model Yavsc.Server.Models.Access.CircleAuthorizationToFile - -@{ - ViewData["Title"] = "Create"; -} - -

Create

- -
-
-

CircleAuthorizationToFile

-
-
-
- -
- - -
-
- -
- -
- - -
-
- -
-
- -
-
-
-
- - - diff --git a/src/Yavsc/Views/MyFSRules/Delete.cshtml b/src/Yavsc/Views/MyFSRules/Delete.cshtml deleted file mode 100644 index b46c1a87..00000000 --- a/src/Yavsc/Views/MyFSRules/Delete.cshtml +++ /dev/null @@ -1,30 +0,0 @@ -@model Yavsc.Server.Models.Access.CircleAuthorizationToFile - -@{ - ViewData["Title"] = "Delete"; -} - -

Delete

- -

Are you sure you want to delete this?

-
-

CircleAuthorizationToFile

-
-
-
- -
-
-
-
-
@Model.Circle.Name
-
-
@Model.FullPath
-
- - - | - Back to List -
-
-
diff --git a/src/Yavsc/Views/MyFSRules/Details.cshtml b/src/Yavsc/Views/MyFSRules/Details.cshtml deleted file mode 100644 index 12f90e5f..00000000 --- a/src/Yavsc/Views/MyFSRules/Details.cshtml +++ /dev/null @@ -1,24 +0,0 @@ -@model Yavsc.Server.Models.Access.CircleAuthorizationToFile - -@{ - ViewData["Title"] = "Details"; -} - -

@SR["Details"]

- -
-

@SR["CircleAuthorizationToFile"]

-
- -
-
-
@Model.Circle.Name
-
-
@Model.FullPath
-
-
-
-

- @Html.ActionLink("Edit", "Edit", new { circleId=Model.CircleId, fullPath=Model.FullPath }) | - @SR["Back to List"] -

diff --git a/src/Yavsc/Views/MyFSRules/Edit.cshtml b/src/Yavsc/Views/MyFSRules/Edit.cshtml deleted file mode 100644 index bb87924d..00000000 --- a/src/Yavsc/Views/MyFSRules/Edit.cshtml +++ /dev/null @@ -1,44 +0,0 @@ -@model Yavsc.Server.Models.Access.CircleAuthorizationToFile - -@{ - ViewData["Title"] = "Edit"; -} - -

Edit

- -
-
-

@SR["Autorisation au fichier"]

-
-
- - -
- -
- @Html.DisplayFor(m=>m.FullPath) - -
-
- -
- -
- - -
-
-
-
- -
-
-
-
- - - diff --git a/src/Yavsc/Views/MyFSRules/Index.cshtml b/src/Yavsc/Views/MyFSRules/Index.cshtml deleted file mode 100644 index 8340d2b4..00000000 --- a/src/Yavsc/Views/MyFSRules/Index.cshtml +++ /dev/null @@ -1,29 +0,0 @@ -@model IEnumerable - -@{ - ViewData["Title"] = "Index"; -} - -

Index

- -

- Create New -

- - - - - - - -@foreach (var item in Model) { - - - - - -} -
@SR["Circle"]@SR["Path"]
@item.Circle.Name@item.FullPath - @Html.ActionLink("Details", "Details", new { circleId=item.CircleId, fullPath=item.FullPath }) | - @Html.ActionLink("Delete", "Delete", new { circleId=item.CircleId, fullPath=item.FullPath }) -
diff --git a/src/Yavsc/Views/OAuth/Authorize.cshtml b/src/Yavsc/Views/OAuth/Authorize.cshtml index db295196..78d2ef94 100644 --- a/src/Yavsc/Views/OAuth/Authorize.cshtml +++ b/src/Yavsc/Views/OAuth/Authorize.cshtml @@ -1,5 +1,4 @@ -@using Microsoft.AspNet.Http.Authentication -@using Microsoft.AspNet.WebUtilities + @using System.Security.Claims @model AuthorisationView @{ @@ -26,4 +25,4 @@

- \ No newline at end of file + diff --git a/src/Yavsc/Views/OAuth/AuthorizeDenied.cshtml b/src/Yavsc/Views/OAuth/AuthorizeDenied.cshtml index 83d4b8f5..68ab8a7f 100644 --- a/src/Yavsc/Views/OAuth/AuthorizeDenied.cshtml +++ b/src/Yavsc/Views/OAuth/AuthorizeDenied.cshtml @@ -1,5 +1,4 @@ -@using Microsoft.AspNet.Http -@using System +@using System @using System.Security.Claims @{ var error = Context.Items["oauth.Error"]; @@ -14,4 +13,4 @@

Authorization denied

- \ No newline at end of file + diff --git a/src/Yavsc/Views/OAuth/AuthorizeError.cshtml b/src/Yavsc/Views/OAuth/AuthorizeError.cshtml index aa78dd1a..a030973a 100644 --- a/src/Yavsc/Views/OAuth/AuthorizeError.cshtml +++ b/src/Yavsc/Views/OAuth/AuthorizeError.cshtml @@ -1,4 +1,4 @@ -@using Microsoft.AspNet.Http + @using System @using System.Security.Claims @{ @@ -17,4 +17,4 @@

Error: @error

@errorDescription

- \ No newline at end of file + diff --git a/src/Yavsc/Views/Shared/Components/Bill/Bill_pdf.cshtml b/src/Yavsc/Views/Shared/Components/Bill/Bill_pdf.cshtml index 55bc05d7..d053469a 100644 --- a/src/Yavsc/Views/Shared/Components/Bill/Bill_pdf.cshtml +++ b/src/Yavsc/Views/Shared/Components/Bill/Bill_pdf.cshtml @@ -3,7 +3,6 @@ @using Microsoft.Extensions.WebEncoders @using System.Diagnostics @using System.Text -@using Yavsc.Formatters @using Yavsc.Helpers @model Yavsc.ViewModels.Gen.PdfGenerationViewModel @@ -19,4 +18,4 @@ @Model.GenerationErrorMessage

Something went wrong ...

-} \ No newline at end of file +} diff --git a/src/Yavsc/Views/Shared/Components/Estimate/Estimate_pdf.cshtml b/src/Yavsc/Views/Shared/Components/Estimate/Estimate_pdf.cshtml index 55bc05d7..d053469a 100644 --- a/src/Yavsc/Views/Shared/Components/Estimate/Estimate_pdf.cshtml +++ b/src/Yavsc/Views/Shared/Components/Estimate/Estimate_pdf.cshtml @@ -3,7 +3,6 @@ @using Microsoft.Extensions.WebEncoders @using System.Diagnostics @using System.Text -@using Yavsc.Formatters @using Yavsc.Helpers @model Yavsc.ViewModels.Gen.PdfGenerationViewModel @@ -19,4 +18,4 @@ @Model.GenerationErrorMessage

Something went wrong ...

-} \ No newline at end of file +} diff --git a/src/Yavsc/Views/Shared/Components/PayPalButton/Default.cshtml b/src/Yavsc/Views/Shared/Components/PayPalButton/Default.cshtml index c7e8568c..9fc4d80b 100644 --- a/src/Yavsc/Views/Shared/Components/PayPalButton/Default.cshtml +++ b/src/Yavsc/Views/Shared/Components/PayPalButton/Default.cshtml @@ -1,5 +1,4 @@ @model NominativeServiceCommand -@inject IOptions PayPalSettings @if (Model!=null && Model.PaymentId!=null) { @@ -27,8 +26,8 @@ - - - - - - - - - - - - @RenderSection("header", required: false) - - -