From b565cf54e555a6bd8e1636bbe703fff5b0c9e377 Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Tue, 2 Aug 2016 17:02:38 +0200 Subject: [PATCH] refabrique --- Yavsc/Controllers/BlogspotController.cs | 16 +- Yavsc/Controllers/FrontOfficeController.cs | 4 +- .../20160802143258_bcontentornot.Designer.cs | 672 ++++++++++++++++++ .../20160802143258_bcontentornot.cs | 17 + .../20160802145351_camelCaseBlog.Designer.cs | 672 ++++++++++++++++++ .../20160802145351_camelCaseBlog.cs | 305 ++++++++ .../ApplicationDbContextModelSnapshot.cs | 16 +- Yavsc/Model/ApplicationDbContext.cs | 2 +- Yavsc/Model/Blog/Blog.cs | 22 +- .../ViewModels/Auth/AuthorisationHandlers.cs | 2 +- Yavsc/Views/Blogspot/Create.cshtml | 22 +- Yavsc/Views/Blogspot/Delete.cshtml | 50 +- Yavsc/Views/Blogspot/Details.cshtml | 26 +- Yavsc/Views/Blogspot/Edit.cshtml | 36 +- Yavsc/Views/Blogspot/Index.cshtml | 12 +- Yavsc/Views/Blogspot/title.cshtml | 28 +- Yavsc/Views/Blogspot/userposts.cshtml | 34 +- 17 files changed, 1797 insertions(+), 139 deletions(-) create mode 100644 Yavsc/Migrations/20160802143258_bcontentornot.Designer.cs create mode 100644 Yavsc/Migrations/20160802143258_bcontentornot.cs create mode 100644 Yavsc/Migrations/20160802145351_camelCaseBlog.Designer.cs create mode 100644 Yavsc/Migrations/20160802145351_camelCaseBlog.cs diff --git a/Yavsc/Controllers/BlogspotController.cs b/Yavsc/Controllers/BlogspotController.cs index 61e88c55..b47133f7 100644 --- a/Yavsc/Controllers/BlogspotController.cs +++ b/Yavsc/Controllers/BlogspotController.cs @@ -44,7 +44,7 @@ namespace Yavsc.Controllers return UserPosts(id); return View(_context.Blogspot.Include( b => b.Author - ).Where(p => p.visible)); + ).Where(p => p.Visible)); } [Route("/Title/{id?}")] @@ -53,7 +53,7 @@ namespace Yavsc.Controllers { return View("Index", _context.Blogspot.Include( b => b.Author - ).Where(x => x.title == id).ToList()); + ).Where(x => x.Title == id).ToList()); } [Route("/Blog/{id?}")] @@ -63,14 +63,14 @@ namespace Yavsc.Controllers if (string.IsNullOrEmpty(id)) return View("Index",_context.Blogspot.Include( b => b.Author - ).Where(p => p.visible)); + ).Where(p => p.Visible)); if (User.IsSignedIn()) return View("Index", _context.Blogspot.Include( b => b.Author ).Where(x => x.Author.UserName == id).ToList()); return View("Index", _context.Blogspot.Include( b => b.Author - ).Where(x => x.Author.UserName == id && x.visible).ToList()); + ).Where(x => x.Author.UserName == id && x.Visible).ToList()); } // GET: Blog/Details/5 [AllowAnonymous] @@ -103,14 +103,14 @@ namespace Yavsc.Controllers [HttpPost, Authorize(), ValidateAntiForgeryToken] public IActionResult Create(Blog blog) { - blog.modified = blog.posted = DateTime.Now; - blog.rate = 0; + blog.Modified = blog.Posted = DateTime.Now; + blog.Rate = 0; blog.AuthorId = User.GetUserId(); _logger.LogWarning($"Post from: {blog.AuthorId}"); ModelState.ClearValidationState("AuthorId"); if (ModelState.IsValid) { - blog.posted = DateTime.Now; + blog.Posted = DateTime.Now; _context.Blogspot.Add(blog); _context.SaveChanges(); return RedirectToAction("Index"); @@ -152,7 +152,7 @@ namespace Yavsc.Controllers var auth = _authorizationService.AuthorizeAsync(User, blog, new EditRequirement()); if (auth.Result) { - blog.modified = DateTime.Now; + blog.Modified = DateTime.Now; _context.Update(blog); _context.SaveChanges(); ViewData["StatusMessage"] = "Post modified"; diff --git a/Yavsc/Controllers/FrontOfficeController.cs b/Yavsc/Controllers/FrontOfficeController.cs index 0b87937d..5899e561 100644 --- a/Yavsc/Controllers/FrontOfficeController.cs +++ b/Yavsc/Controllers/FrontOfficeController.cs @@ -31,8 +31,8 @@ namespace Yavsc.Controllers public ActionResult Index() { var latestPosts = _context.Blogspot.Where( - x => x.visible == true - ).OrderBy(x => x.modified).Take(25).ToArray(); + x => x.Visible == true + ).OrderBy(x => x.Modified).Take(25).ToArray(); return View(latestPosts); } diff --git a/Yavsc/Migrations/20160802143258_bcontentornot.Designer.cs b/Yavsc/Migrations/20160802143258_bcontentornot.Designer.cs new file mode 100644 index 00000000..1df2854b --- /dev/null +++ b/Yavsc/Migrations/20160802143258_bcontentornot.Designer.cs @@ -0,0 +1,672 @@ +using System; +using Microsoft.Data.Entity; +using Microsoft.Data.Entity.Infrastructure; +using Microsoft.Data.Entity.Metadata; +using Microsoft.Data.Entity.Migrations; +using Yavsc.Models; + +namespace Yavsc.Migrations +{ + [DbContext(typeof(ApplicationDbContext))] + [Migration("20160802143258_bcontentornot")] + partial class bcontentornot + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { + modelBuilder + .HasAnnotation("ProductVersion", "7.0.0-rc1-16348"); + + modelBuilder.Entity("Microsoft.AspNet.Identity.EntityFramework.IdentityRole", b => + { + b.Property("Id"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken(); + + b.Property("Name") + .HasAnnotation("MaxLength", 256); + + b.Property("NormalizedName") + .HasAnnotation("MaxLength", 256); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName") + .HasAnnotation("Relational:Name", "RoleNameIndex"); + + b.HasAnnotation("Relational:TableName", "AspNetRoles"); + }); + + modelBuilder.Entity("Microsoft.AspNet.Identity.EntityFramework.IdentityRoleClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("ClaimType"); + + b.Property("ClaimValue"); + + b.Property("RoleId") + .IsRequired(); + + b.HasKey("Id"); + + b.HasAnnotation("Relational:TableName", "AspNetRoleClaims"); + }); + + modelBuilder.Entity("Microsoft.AspNet.Identity.EntityFramework.IdentityUserClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("ClaimType"); + + b.Property("ClaimValue"); + + b.Property("UserId") + .IsRequired(); + + b.HasKey("Id"); + + b.HasAnnotation("Relational:TableName", "AspNetUserClaims"); + }); + + modelBuilder.Entity("Microsoft.AspNet.Identity.EntityFramework.IdentityUserLogin", b => + { + b.Property("LoginProvider"); + + b.Property("ProviderKey"); + + b.Property("ProviderDisplayName"); + + b.Property("UserId") + .IsRequired(); + + b.HasKey("LoginProvider", "ProviderKey"); + + b.HasAnnotation("Relational:TableName", "AspNetUserLogins"); + }); + + modelBuilder.Entity("Microsoft.AspNet.Identity.EntityFramework.IdentityUserRole", b => + { + b.Property("UserId"); + + b.Property("RoleId"); + + b.HasKey("UserId", "RoleId"); + + b.HasAnnotation("Relational:TableName", "AspNetUserRoles"); + }); + + modelBuilder.Entity("Yavsc.Location", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Address") + .IsRequired(); + + b.Property("Latitude"); + + b.Property("Longitude"); + + b.HasKey("Id"); + }); + + modelBuilder.Entity("Yavsc.Models.AccountBalance", b => + { + b.Property("UserId"); + + b.Property("ContactCredits"); + + b.Property("Credits"); + + b.HasKey("UserId"); + }); + + modelBuilder.Entity("Yavsc.Models.Activity", b => + { + b.Property("Code") + .HasAnnotation("MaxLength", 512); + + b.Property("ActorDenomination"); + + b.Property("Description"); + + b.Property("ModeratorGroupName"); + + b.Property("Name") + .IsRequired() + .HasAnnotation("MaxLength", 512); + + b.Property("Photo"); + + b.HasKey("Code"); + }); + + modelBuilder.Entity("Yavsc.Models.ApplicationUser", b => + { + b.Property("Id"); + + b.Property("AccessFailedCount"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken(); + + b.Property("DedicatedGoogleCalendar"); + + b.Property("Email") + .HasAnnotation("MaxLength", 256); + + b.Property("EmailConfirmed"); + + b.Property("LockoutEnabled"); + + b.Property("LockoutEnd"); + + b.Property("NormalizedEmail") + .HasAnnotation("MaxLength", 256); + + b.Property("NormalizedUserName") + .HasAnnotation("MaxLength", 256); + + b.Property("PasswordHash"); + + b.Property("PhoneNumber"); + + b.Property("PhoneNumberConfirmed"); + + b.Property("PostalAddressId"); + + b.Property("SecurityStamp"); + + b.Property("TwoFactorEnabled"); + + b.Property("UserName") + .HasAnnotation("MaxLength", 256); + + b.HasKey("Id"); + + b.HasIndex("NormalizedEmail") + .HasAnnotation("Relational:Name", "EmailIndex"); + + b.HasIndex("NormalizedUserName") + .HasAnnotation("Relational:Name", "UserNameIndex"); + + b.HasAnnotation("Relational:TableName", "AspNetUsers"); + }); + + modelBuilder.Entity("Yavsc.Models.Auth.Client", b => + { + b.Property("Id"); + + b.Property("Active"); + + b.Property("DisplayName"); + + b.Property("LogoutRedirectUri") + .HasAnnotation("MaxLength", 100); + + b.Property("RedirectUri"); + + b.Property("RefreshTokenLifeTime"); + + b.Property("Secret"); + + b.Property("Type"); + + b.HasKey("Id"); + }); + + modelBuilder.Entity("Yavsc.Models.Auth.RefreshToken", b => + { + b.Property("Id"); + + b.Property("ClientId") + .IsRequired() + .HasAnnotation("MaxLength", 50); + + b.Property("ExpiresUtc"); + + b.Property("IssuedUtc"); + + b.Property("ProtectedTicket") + .IsRequired(); + + b.Property("Subject") + .IsRequired() + .HasAnnotation("MaxLength", 50); + + b.HasKey("Id"); + }); + + modelBuilder.Entity("Yavsc.Models.BalanceImpact", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("BalanceId") + .IsRequired(); + + b.Property("ExecDate"); + + b.Property("Impact"); + + b.Property("Reason") + .IsRequired(); + + b.HasKey("Id"); + }); + + modelBuilder.Entity("Yavsc.Models.Billing.CommandLine", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("ArticleId"); + + b.Property("BookQueryId"); + + b.Property("Comment"); + + b.Property("Count"); + + b.Property("EstimateId"); + + b.Property("UnitaryCost"); + + b.HasKey("Id"); + }); + + modelBuilder.Entity("Yavsc.Models.Billing.Estimate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("AttachedFilesString"); + + b.Property("AttachedGraphicsString"); + + b.Property("CommandId"); + + b.Property("Description"); + + b.Property("Status"); + + b.Property("Title"); + + b.HasKey("Id"); + }); + + modelBuilder.Entity("Yavsc.Models.Billing.ExceptionSIREN", b => + { + b.Property("SIREN"); + + b.HasKey("SIREN"); + }); + + modelBuilder.Entity("Yavsc.Models.Blog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("AuthorId"); + + b.Property("Content"); + + b.Property("modified"); + + b.Property("photo"); + + b.Property("posted") + .ValueGeneratedOnAdd() + .HasAnnotation("Relational:GeneratedValueSql", "LOCALTIMESTAMP"); + + b.Property("rate"); + + b.Property("title"); + + b.Property("visible"); + + b.HasKey("Id"); + }); + + modelBuilder.Entity("Yavsc.Models.Booking.BookQuery", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("ClientId") + .IsRequired(); + + b.Property("CreationDate") + .ValueGeneratedOnAdd() + .HasAnnotation("Relational:GeneratedValueSql", "LOCALTIMESTAMP"); + + b.Property("EventDate"); + + b.Property("Lag"); + + b.Property("LocationId"); + + b.Property("PerformerId") + .IsRequired(); + + b.Property("Previsional"); + + b.Property("ValidationDate"); + + b.HasKey("Id"); + }); + + modelBuilder.Entity("Yavsc.Models.Circle", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Name"); + + b.Property("OwnerId"); + + b.HasKey("Id"); + }); + + modelBuilder.Entity("Yavsc.Models.CircleMember", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("CircleId") + .IsRequired(); + + b.Property("MemberId") + .IsRequired(); + + b.HasKey("Id"); + }); + + modelBuilder.Entity("Yavsc.Models.Contact", b => + { + b.Property("OwnerId"); + + b.Property("UserId"); + + b.HasKey("OwnerId", "UserId"); + }); + + modelBuilder.Entity("Yavsc.Models.Identity.GoogleCloudMobileDeclaration", b => + { + b.Property("DeviceId"); + + b.Property("DeclarationDate") + .ValueGeneratedOnAdd() + .HasAnnotation("Relational:GeneratedValueSql", "LOCALTIMESTAMP"); + + b.Property("DeviceOwnerId"); + + b.Property("GCMRegistrationId") + .IsRequired(); + + b.Property("Model"); + + b.Property("Platform"); + + b.Property("Version"); + + b.HasKey("DeviceId"); + }); + + modelBuilder.Entity("Yavsc.Models.Market.BaseProduct", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Description"); + + b.Property("Name"); + + b.Property("Public"); + + b.HasKey("Id"); + }); + + modelBuilder.Entity("Yavsc.Models.Market.Service", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Billing"); + + b.Property("ContextId"); + + b.Property("Description"); + + b.Property("Name"); + + b.Property("Pricing"); + + b.Property("Public"); + + b.HasKey("Id"); + }); + + modelBuilder.Entity("Yavsc.Models.OAuth.OAuth2Tokens", b => + { + b.Property("UserId"); + + b.Property("AccessToken"); + + b.Property("Expiration"); + + b.Property("ExpiresIn"); + + b.Property("RefreshToken"); + + b.Property("TokenType"); + + b.HasKey("UserId"); + }); + + modelBuilder.Entity("Yavsc.Models.Skill", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Name"); + + b.Property("Rate"); + + b.HasKey("Id"); + }); + + modelBuilder.Entity("Yavsc.Models.Workflow.PerformerProfile", b => + { + b.Property("PerformerId"); + + b.Property("AcceptGeoLocalization"); + + b.Property("AcceptNotifications"); + + b.Property("AcceptPublicContact"); + + b.Property("Active"); + + b.Property("ActivityCode") + .IsRequired(); + + b.Property("MaxDailyCost"); + + b.Property("MinDailyCost"); + + b.Property("OfferId"); + + b.Property("OrganizationAddressId"); + + b.Property("Rate"); + + b.Property("SIREN") + .IsRequired() + .HasAnnotation("MaxLength", 14); + + b.Property("WebSite"); + + b.HasKey("PerformerId"); + }); + + modelBuilder.Entity("Microsoft.AspNet.Identity.EntityFramework.IdentityRoleClaim", b => + { + b.HasOne("Microsoft.AspNet.Identity.EntityFramework.IdentityRole") + .WithMany() + .HasForeignKey("RoleId"); + }); + + modelBuilder.Entity("Microsoft.AspNet.Identity.EntityFramework.IdentityUserClaim", b => + { + b.HasOne("Yavsc.Models.ApplicationUser") + .WithMany() + .HasForeignKey("UserId"); + }); + + modelBuilder.Entity("Microsoft.AspNet.Identity.EntityFramework.IdentityUserLogin", b => + { + b.HasOne("Yavsc.Models.ApplicationUser") + .WithMany() + .HasForeignKey("UserId"); + }); + + modelBuilder.Entity("Microsoft.AspNet.Identity.EntityFramework.IdentityUserRole", b => + { + b.HasOne("Microsoft.AspNet.Identity.EntityFramework.IdentityRole") + .WithMany() + .HasForeignKey("RoleId"); + + b.HasOne("Yavsc.Models.ApplicationUser") + .WithMany() + .HasForeignKey("UserId"); + }); + + modelBuilder.Entity("Yavsc.Models.AccountBalance", b => + { + b.HasOne("Yavsc.Models.ApplicationUser") + .WithOne() + .HasForeignKey("Yavsc.Models.AccountBalance", "UserId"); + }); + + modelBuilder.Entity("Yavsc.Models.ApplicationUser", b => + { + b.HasOne("Yavsc.Location") + .WithMany() + .HasForeignKey("PostalAddressId"); + }); + + modelBuilder.Entity("Yavsc.Models.BalanceImpact", b => + { + b.HasOne("Yavsc.Models.AccountBalance") + .WithMany() + .HasForeignKey("BalanceId"); + }); + + modelBuilder.Entity("Yavsc.Models.Billing.CommandLine", b => + { + b.HasOne("Yavsc.Models.Market.BaseProduct") + .WithMany() + .HasForeignKey("ArticleId"); + + b.HasOne("Yavsc.Models.Booking.BookQuery") + .WithMany() + .HasForeignKey("BookQueryId"); + + b.HasOne("Yavsc.Models.Billing.Estimate") + .WithMany() + .HasForeignKey("EstimateId"); + }); + + modelBuilder.Entity("Yavsc.Models.Billing.Estimate", b => + { + b.HasOne("Yavsc.Models.Booking.BookQuery") + .WithMany() + .HasForeignKey("CommandId"); + }); + + modelBuilder.Entity("Yavsc.Models.Blog", b => + { + b.HasOne("Yavsc.Models.ApplicationUser") + .WithMany() + .HasForeignKey("AuthorId"); + }); + + modelBuilder.Entity("Yavsc.Models.Booking.BookQuery", b => + { + b.HasOne("Yavsc.Models.ApplicationUser") + .WithMany() + .HasForeignKey("ClientId"); + + b.HasOne("Yavsc.Location") + .WithMany() + .HasForeignKey("LocationId"); + + b.HasOne("Yavsc.Models.Workflow.PerformerProfile") + .WithMany() + .HasForeignKey("PerformerId"); + }); + + modelBuilder.Entity("Yavsc.Models.Circle", b => + { + b.HasOne("Yavsc.Models.ApplicationUser") + .WithMany() + .HasForeignKey("OwnerId"); + }); + + modelBuilder.Entity("Yavsc.Models.CircleMember", b => + { + b.HasOne("Yavsc.Models.Circle") + .WithMany() + .HasForeignKey("CircleId"); + + b.HasOne("Yavsc.Models.ApplicationUser") + .WithMany() + .HasForeignKey("MemberId"); + }); + + modelBuilder.Entity("Yavsc.Models.Contact", b => + { + b.HasOne("Yavsc.Models.ApplicationUser") + .WithMany() + .HasForeignKey("OwnerId"); + }); + + modelBuilder.Entity("Yavsc.Models.Identity.GoogleCloudMobileDeclaration", b => + { + b.HasOne("Yavsc.Models.ApplicationUser") + .WithMany() + .HasForeignKey("DeviceOwnerId"); + }); + + modelBuilder.Entity("Yavsc.Models.Market.Service", b => + { + b.HasOne("Yavsc.Models.Activity") + .WithMany() + .HasForeignKey("ContextId"); + }); + + modelBuilder.Entity("Yavsc.Models.Workflow.PerformerProfile", b => + { + b.HasOne("Yavsc.Models.Activity") + .WithMany() + .HasForeignKey("ActivityCode"); + + b.HasOne("Yavsc.Models.Market.Service") + .WithMany() + .HasForeignKey("OfferId"); + + b.HasOne("Yavsc.Location") + .WithMany() + .HasForeignKey("OrganizationAddressId"); + + b.HasOne("Yavsc.Models.ApplicationUser") + .WithMany() + .HasForeignKey("PerformerId"); + }); + } + } +} diff --git a/Yavsc/Migrations/20160802143258_bcontentornot.cs b/Yavsc/Migrations/20160802143258_bcontentornot.cs new file mode 100644 index 00000000..c1bb6fa4 --- /dev/null +++ b/Yavsc/Migrations/20160802143258_bcontentornot.cs @@ -0,0 +1,17 @@ +using Microsoft.Data.Entity.Migrations; + +namespace Yavsc.Migrations +{ + public partial class bcontentornot : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.RenameColumn(name: "bcontent", table: "Blog", newName:"Content"); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.RenameColumn(name: "Content", table: "Blog", newName:"bcontent"); + } + } +} diff --git a/Yavsc/Migrations/20160802145351_camelCaseBlog.Designer.cs b/Yavsc/Migrations/20160802145351_camelCaseBlog.Designer.cs new file mode 100644 index 00000000..2516eaff --- /dev/null +++ b/Yavsc/Migrations/20160802145351_camelCaseBlog.Designer.cs @@ -0,0 +1,672 @@ +using System; +using Microsoft.Data.Entity; +using Microsoft.Data.Entity.Infrastructure; +using Microsoft.Data.Entity.Metadata; +using Microsoft.Data.Entity.Migrations; +using Yavsc.Models; + +namespace Yavsc.Migrations +{ + [DbContext(typeof(ApplicationDbContext))] + [Migration("20160802145351_camelCaseBlog")] + partial class camelCaseBlog + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { + modelBuilder + .HasAnnotation("ProductVersion", "7.0.0-rc1-16348"); + + modelBuilder.Entity("Microsoft.AspNet.Identity.EntityFramework.IdentityRole", b => + { + b.Property("Id"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken(); + + b.Property("Name") + .HasAnnotation("MaxLength", 256); + + b.Property("NormalizedName") + .HasAnnotation("MaxLength", 256); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName") + .HasAnnotation("Relational:Name", "RoleNameIndex"); + + b.HasAnnotation("Relational:TableName", "AspNetRoles"); + }); + + modelBuilder.Entity("Microsoft.AspNet.Identity.EntityFramework.IdentityRoleClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("ClaimType"); + + b.Property("ClaimValue"); + + b.Property("RoleId") + .IsRequired(); + + b.HasKey("Id"); + + b.HasAnnotation("Relational:TableName", "AspNetRoleClaims"); + }); + + modelBuilder.Entity("Microsoft.AspNet.Identity.EntityFramework.IdentityUserClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("ClaimType"); + + b.Property("ClaimValue"); + + b.Property("UserId") + .IsRequired(); + + b.HasKey("Id"); + + b.HasAnnotation("Relational:TableName", "AspNetUserClaims"); + }); + + modelBuilder.Entity("Microsoft.AspNet.Identity.EntityFramework.IdentityUserLogin", b => + { + b.Property("LoginProvider"); + + b.Property("ProviderKey"); + + b.Property("ProviderDisplayName"); + + b.Property("UserId") + .IsRequired(); + + b.HasKey("LoginProvider", "ProviderKey"); + + b.HasAnnotation("Relational:TableName", "AspNetUserLogins"); + }); + + modelBuilder.Entity("Microsoft.AspNet.Identity.EntityFramework.IdentityUserRole", b => + { + b.Property("UserId"); + + b.Property("RoleId"); + + b.HasKey("UserId", "RoleId"); + + b.HasAnnotation("Relational:TableName", "AspNetUserRoles"); + }); + + modelBuilder.Entity("Yavsc.Location", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Address") + .IsRequired(); + + b.Property("Latitude"); + + b.Property("Longitude"); + + b.HasKey("Id"); + }); + + modelBuilder.Entity("Yavsc.Models.AccountBalance", b => + { + b.Property("UserId"); + + b.Property("ContactCredits"); + + b.Property("Credits"); + + b.HasKey("UserId"); + }); + + modelBuilder.Entity("Yavsc.Models.Activity", b => + { + b.Property("Code") + .HasAnnotation("MaxLength", 512); + + b.Property("ActorDenomination"); + + b.Property("Description"); + + b.Property("ModeratorGroupName"); + + b.Property("Name") + .IsRequired() + .HasAnnotation("MaxLength", 512); + + b.Property("Photo"); + + b.HasKey("Code"); + }); + + modelBuilder.Entity("Yavsc.Models.ApplicationUser", b => + { + b.Property("Id"); + + b.Property("AccessFailedCount"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken(); + + b.Property("DedicatedGoogleCalendar"); + + b.Property("Email") + .HasAnnotation("MaxLength", 256); + + b.Property("EmailConfirmed"); + + b.Property("LockoutEnabled"); + + b.Property("LockoutEnd"); + + b.Property("NormalizedEmail") + .HasAnnotation("MaxLength", 256); + + b.Property("NormalizedUserName") + .HasAnnotation("MaxLength", 256); + + b.Property("PasswordHash"); + + b.Property("PhoneNumber"); + + b.Property("PhoneNumberConfirmed"); + + b.Property("PostalAddressId"); + + b.Property("SecurityStamp"); + + b.Property("TwoFactorEnabled"); + + b.Property("UserName") + .HasAnnotation("MaxLength", 256); + + b.HasKey("Id"); + + b.HasIndex("NormalizedEmail") + .HasAnnotation("Relational:Name", "EmailIndex"); + + b.HasIndex("NormalizedUserName") + .HasAnnotation("Relational:Name", "UserNameIndex"); + + b.HasAnnotation("Relational:TableName", "AspNetUsers"); + }); + + modelBuilder.Entity("Yavsc.Models.Auth.Client", b => + { + b.Property("Id"); + + b.Property("Active"); + + b.Property("DisplayName"); + + b.Property("LogoutRedirectUri") + .HasAnnotation("MaxLength", 100); + + b.Property("RedirectUri"); + + b.Property("RefreshTokenLifeTime"); + + b.Property("Secret"); + + b.Property("Type"); + + b.HasKey("Id"); + }); + + modelBuilder.Entity("Yavsc.Models.Auth.RefreshToken", b => + { + b.Property("Id"); + + b.Property("ClientId") + .IsRequired() + .HasAnnotation("MaxLength", 50); + + b.Property("ExpiresUtc"); + + b.Property("IssuedUtc"); + + b.Property("ProtectedTicket") + .IsRequired(); + + b.Property("Subject") + .IsRequired() + .HasAnnotation("MaxLength", 50); + + b.HasKey("Id"); + }); + + modelBuilder.Entity("Yavsc.Models.BalanceImpact", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("BalanceId") + .IsRequired(); + + b.Property("ExecDate"); + + b.Property("Impact"); + + b.Property("Reason") + .IsRequired(); + + b.HasKey("Id"); + }); + + modelBuilder.Entity("Yavsc.Models.Billing.CommandLine", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("ArticleId"); + + b.Property("BookQueryId"); + + b.Property("Comment"); + + b.Property("Count"); + + b.Property("EstimateId"); + + b.Property("UnitaryCost"); + + b.HasKey("Id"); + }); + + modelBuilder.Entity("Yavsc.Models.Billing.Estimate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("AttachedFilesString"); + + b.Property("AttachedGraphicsString"); + + b.Property("CommandId"); + + b.Property("Description"); + + b.Property("Status"); + + b.Property("Title"); + + b.HasKey("Id"); + }); + + modelBuilder.Entity("Yavsc.Models.Billing.ExceptionSIREN", b => + { + b.Property("SIREN"); + + b.HasKey("SIREN"); + }); + + modelBuilder.Entity("Yavsc.Models.Blog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("AuthorId"); + + b.Property("Content"); + + b.Property("Modified"); + + b.Property("Photo"); + + b.Property("Posted") + .ValueGeneratedOnAdd() + .HasAnnotation("Relational:GeneratedValueSql", "LOCALTIMESTAMP"); + + b.Property("Rate"); + + b.Property("Title"); + + b.Property("Visible"); + + b.HasKey("Id"); + }); + + modelBuilder.Entity("Yavsc.Models.Booking.BookQuery", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("ClientId") + .IsRequired(); + + b.Property("CreationDate") + .ValueGeneratedOnAdd() + .HasAnnotation("Relational:GeneratedValueSql", "LOCALTIMESTAMP"); + + b.Property("EventDate"); + + b.Property("Lag"); + + b.Property("LocationId"); + + b.Property("PerformerId") + .IsRequired(); + + b.Property("Previsional"); + + b.Property("ValidationDate"); + + b.HasKey("Id"); + }); + + modelBuilder.Entity("Yavsc.Models.Circle", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Name"); + + b.Property("OwnerId"); + + b.HasKey("Id"); + }); + + modelBuilder.Entity("Yavsc.Models.CircleMember", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("CircleId") + .IsRequired(); + + b.Property("MemberId") + .IsRequired(); + + b.HasKey("Id"); + }); + + modelBuilder.Entity("Yavsc.Models.Contact", b => + { + b.Property("OwnerId"); + + b.Property("UserId"); + + b.HasKey("OwnerId", "UserId"); + }); + + modelBuilder.Entity("Yavsc.Models.Identity.GoogleCloudMobileDeclaration", b => + { + b.Property("DeviceId"); + + b.Property("DeclarationDate") + .ValueGeneratedOnAdd() + .HasAnnotation("Relational:GeneratedValueSql", "LOCALTIMESTAMP"); + + b.Property("DeviceOwnerId"); + + b.Property("GCMRegistrationId") + .IsRequired(); + + b.Property("Model"); + + b.Property("Platform"); + + b.Property("Version"); + + b.HasKey("DeviceId"); + }); + + modelBuilder.Entity("Yavsc.Models.Market.BaseProduct", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Description"); + + b.Property("Name"); + + b.Property("Public"); + + b.HasKey("Id"); + }); + + modelBuilder.Entity("Yavsc.Models.Market.Service", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Billing"); + + b.Property("ContextId"); + + b.Property("Description"); + + b.Property("Name"); + + b.Property("Pricing"); + + b.Property("Public"); + + b.HasKey("Id"); + }); + + modelBuilder.Entity("Yavsc.Models.OAuth.OAuth2Tokens", b => + { + b.Property("UserId"); + + b.Property("AccessToken"); + + b.Property("Expiration"); + + b.Property("ExpiresIn"); + + b.Property("RefreshToken"); + + b.Property("TokenType"); + + b.HasKey("UserId"); + }); + + modelBuilder.Entity("Yavsc.Models.Skill", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Name"); + + b.Property("Rate"); + + b.HasKey("Id"); + }); + + modelBuilder.Entity("Yavsc.Models.Workflow.PerformerProfile", b => + { + b.Property("PerformerId"); + + b.Property("AcceptGeoLocalization"); + + b.Property("AcceptNotifications"); + + b.Property("AcceptPublicContact"); + + b.Property("Active"); + + b.Property("ActivityCode") + .IsRequired(); + + b.Property("MaxDailyCost"); + + b.Property("MinDailyCost"); + + b.Property("OfferId"); + + b.Property("OrganizationAddressId"); + + b.Property("Rate"); + + b.Property("SIREN") + .IsRequired() + .HasAnnotation("MaxLength", 14); + + b.Property("WebSite"); + + b.HasKey("PerformerId"); + }); + + modelBuilder.Entity("Microsoft.AspNet.Identity.EntityFramework.IdentityRoleClaim", b => + { + b.HasOne("Microsoft.AspNet.Identity.EntityFramework.IdentityRole") + .WithMany() + .HasForeignKey("RoleId"); + }); + + modelBuilder.Entity("Microsoft.AspNet.Identity.EntityFramework.IdentityUserClaim", b => + { + b.HasOne("Yavsc.Models.ApplicationUser") + .WithMany() + .HasForeignKey("UserId"); + }); + + modelBuilder.Entity("Microsoft.AspNet.Identity.EntityFramework.IdentityUserLogin", b => + { + b.HasOne("Yavsc.Models.ApplicationUser") + .WithMany() + .HasForeignKey("UserId"); + }); + + modelBuilder.Entity("Microsoft.AspNet.Identity.EntityFramework.IdentityUserRole", b => + { + b.HasOne("Microsoft.AspNet.Identity.EntityFramework.IdentityRole") + .WithMany() + .HasForeignKey("RoleId"); + + b.HasOne("Yavsc.Models.ApplicationUser") + .WithMany() + .HasForeignKey("UserId"); + }); + + modelBuilder.Entity("Yavsc.Models.AccountBalance", b => + { + b.HasOne("Yavsc.Models.ApplicationUser") + .WithOne() + .HasForeignKey("Yavsc.Models.AccountBalance", "UserId"); + }); + + modelBuilder.Entity("Yavsc.Models.ApplicationUser", b => + { + b.HasOne("Yavsc.Location") + .WithMany() + .HasForeignKey("PostalAddressId"); + }); + + modelBuilder.Entity("Yavsc.Models.BalanceImpact", b => + { + b.HasOne("Yavsc.Models.AccountBalance") + .WithMany() + .HasForeignKey("BalanceId"); + }); + + modelBuilder.Entity("Yavsc.Models.Billing.CommandLine", b => + { + b.HasOne("Yavsc.Models.Market.BaseProduct") + .WithMany() + .HasForeignKey("ArticleId"); + + b.HasOne("Yavsc.Models.Booking.BookQuery") + .WithMany() + .HasForeignKey("BookQueryId"); + + b.HasOne("Yavsc.Models.Billing.Estimate") + .WithMany() + .HasForeignKey("EstimateId"); + }); + + modelBuilder.Entity("Yavsc.Models.Billing.Estimate", b => + { + b.HasOne("Yavsc.Models.Booking.BookQuery") + .WithMany() + .HasForeignKey("CommandId"); + }); + + modelBuilder.Entity("Yavsc.Models.Blog", b => + { + b.HasOne("Yavsc.Models.ApplicationUser") + .WithMany() + .HasForeignKey("AuthorId"); + }); + + modelBuilder.Entity("Yavsc.Models.Booking.BookQuery", b => + { + b.HasOne("Yavsc.Models.ApplicationUser") + .WithMany() + .HasForeignKey("ClientId"); + + b.HasOne("Yavsc.Location") + .WithMany() + .HasForeignKey("LocationId"); + + b.HasOne("Yavsc.Models.Workflow.PerformerProfile") + .WithMany() + .HasForeignKey("PerformerId"); + }); + + modelBuilder.Entity("Yavsc.Models.Circle", b => + { + b.HasOne("Yavsc.Models.ApplicationUser") + .WithMany() + .HasForeignKey("OwnerId"); + }); + + modelBuilder.Entity("Yavsc.Models.CircleMember", b => + { + b.HasOne("Yavsc.Models.Circle") + .WithMany() + .HasForeignKey("CircleId"); + + b.HasOne("Yavsc.Models.ApplicationUser") + .WithMany() + .HasForeignKey("MemberId"); + }); + + modelBuilder.Entity("Yavsc.Models.Contact", b => + { + b.HasOne("Yavsc.Models.ApplicationUser") + .WithMany() + .HasForeignKey("OwnerId"); + }); + + modelBuilder.Entity("Yavsc.Models.Identity.GoogleCloudMobileDeclaration", b => + { + b.HasOne("Yavsc.Models.ApplicationUser") + .WithMany() + .HasForeignKey("DeviceOwnerId"); + }); + + modelBuilder.Entity("Yavsc.Models.Market.Service", b => + { + b.HasOne("Yavsc.Models.Activity") + .WithMany() + .HasForeignKey("ContextId"); + }); + + modelBuilder.Entity("Yavsc.Models.Workflow.PerformerProfile", b => + { + b.HasOne("Yavsc.Models.Activity") + .WithMany() + .HasForeignKey("ActivityCode"); + + b.HasOne("Yavsc.Models.Market.Service") + .WithMany() + .HasForeignKey("OfferId"); + + b.HasOne("Yavsc.Location") + .WithMany() + .HasForeignKey("OrganizationAddressId"); + + b.HasOne("Yavsc.Models.ApplicationUser") + .WithMany() + .HasForeignKey("PerformerId"); + }); + } + } +} diff --git a/Yavsc/Migrations/20160802145351_camelCaseBlog.cs b/Yavsc/Migrations/20160802145351_camelCaseBlog.cs new file mode 100644 index 00000000..1926359a --- /dev/null +++ b/Yavsc/Migrations/20160802145351_camelCaseBlog.cs @@ -0,0 +1,305 @@ +using System; +using System.Collections.Generic; +using Microsoft.Data.Entity.Migrations; + +namespace Yavsc.Migrations +{ + public partial class camelCaseBlog : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey(name: "FK_IdentityRoleClaim_IdentityRole_RoleId", table: "AspNetRoleClaims"); + migrationBuilder.DropForeignKey(name: "FK_IdentityUserClaim_ApplicationUser_UserId", table: "AspNetUserClaims"); + migrationBuilder.DropForeignKey(name: "FK_IdentityUserLogin_ApplicationUser_UserId", table: "AspNetUserLogins"); + migrationBuilder.DropForeignKey(name: "FK_IdentityUserRole_IdentityRole_RoleId", table: "AspNetUserRoles"); + migrationBuilder.DropForeignKey(name: "FK_IdentityUserRole_ApplicationUser_UserId", table: "AspNetUserRoles"); + migrationBuilder.DropForeignKey(name: "FK_AccountBalance_ApplicationUser_UserId", table: "AccountBalance"); + migrationBuilder.DropForeignKey(name: "FK_BalanceImpact_AccountBalance_BalanceId", table: "BalanceImpact"); + migrationBuilder.DropForeignKey(name: "FK_BookQuery_ApplicationUser_ClientId", table: "BookQuery"); + migrationBuilder.DropForeignKey(name: "FK_BookQuery_PerformerProfile_PerformerId", table: "BookQuery"); + migrationBuilder.DropForeignKey(name: "FK_CircleMember_Circle_CircleId", table: "CircleMember"); + migrationBuilder.DropForeignKey(name: "FK_CircleMember_ApplicationUser_MemberId", table: "CircleMember"); + migrationBuilder.DropForeignKey(name: "FK_Contact_ApplicationUser_OwnerId", table: "Contact"); + migrationBuilder.DropForeignKey(name: "FK_PerformerProfile_Activity_ActivityCode", table: "PerformerProfile"); + migrationBuilder.DropForeignKey(name: "FK_PerformerProfile_Location_OrganizationAddressId", table: "PerformerProfile"); + migrationBuilder.DropForeignKey(name: "FK_PerformerProfile_ApplicationUser_PerformerId", table: "PerformerProfile"); + migrationBuilder.AddForeignKey( + name: "FK_IdentityRoleClaim_IdentityRole_RoleId", + table: "AspNetRoleClaims", + column: "RoleId", + principalTable: "AspNetRoles", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + migrationBuilder.AddForeignKey( + name: "FK_IdentityUserClaim_ApplicationUser_UserId", + table: "AspNetUserClaims", + column: "UserId", + principalTable: "AspNetUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + migrationBuilder.AddForeignKey( + name: "FK_IdentityUserLogin_ApplicationUser_UserId", + table: "AspNetUserLogins", + column: "UserId", + principalTable: "AspNetUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + migrationBuilder.AddForeignKey( + name: "FK_IdentityUserRole_IdentityRole_RoleId", + table: "AspNetUserRoles", + column: "RoleId", + principalTable: "AspNetRoles", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + migrationBuilder.AddForeignKey( + name: "FK_IdentityUserRole_ApplicationUser_UserId", + table: "AspNetUserRoles", + column: "UserId", + principalTable: "AspNetUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + migrationBuilder.AddForeignKey( + name: "FK_AccountBalance_ApplicationUser_UserId", + table: "AccountBalance", + column: "UserId", + principalTable: "AspNetUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + migrationBuilder.AddForeignKey( + name: "FK_BalanceImpact_AccountBalance_BalanceId", + table: "BalanceImpact", + column: "BalanceId", + principalTable: "AccountBalance", + principalColumn: "UserId", + onDelete: ReferentialAction.Cascade); + migrationBuilder.AddForeignKey( + name: "FK_BookQuery_ApplicationUser_ClientId", + table: "BookQuery", + column: "ClientId", + principalTable: "AspNetUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + migrationBuilder.AddForeignKey( + name: "FK_BookQuery_PerformerProfile_PerformerId", + table: "BookQuery", + column: "PerformerId", + principalTable: "PerformerProfile", + principalColumn: "PerformerId", + onDelete: ReferentialAction.Cascade); + migrationBuilder.AddForeignKey( + name: "FK_CircleMember_Circle_CircleId", + table: "CircleMember", + column: "CircleId", + principalTable: "Circle", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + migrationBuilder.AddForeignKey( + name: "FK_CircleMember_ApplicationUser_MemberId", + table: "CircleMember", + column: "MemberId", + principalTable: "AspNetUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + migrationBuilder.AddForeignKey( + name: "FK_Contact_ApplicationUser_OwnerId", + table: "Contact", + column: "OwnerId", + principalTable: "AspNetUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + migrationBuilder.AddForeignKey( + name: "FK_PerformerProfile_Activity_ActivityCode", + table: "PerformerProfile", + column: "ActivityCode", + principalTable: "Activity", + principalColumn: "Code", + onDelete: ReferentialAction.Cascade); + migrationBuilder.AddForeignKey( + name: "FK_PerformerProfile_Location_OrganizationAddressId", + table: "PerformerProfile", + column: "OrganizationAddressId", + principalTable: "Location", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + migrationBuilder.AddForeignKey( + name: "FK_PerformerProfile_ApplicationUser_PerformerId", + table: "PerformerProfile", + column: "PerformerId", + principalTable: "AspNetUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + migrationBuilder.RenameColumn( + name: "visible", + table: "Blog", + newName: "Visible"); + migrationBuilder.RenameColumn( + name: "title", + table: "Blog", + newName: "Title"); + migrationBuilder.RenameColumn( + name: "rate", + table: "Blog", + newName: "Rate"); + migrationBuilder.RenameColumn( + name: "posted", + table: "Blog", + newName: "Posted"); + migrationBuilder.RenameColumn( + name: "photo", + table: "Blog", + newName: "Photo"); + migrationBuilder.RenameColumn( + name: "modified", + table: "Blog", + newName: "Modified"); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey(name: "FK_IdentityRoleClaim_IdentityRole_RoleId", table: "AspNetRoleClaims"); + migrationBuilder.DropForeignKey(name: "FK_IdentityUserClaim_ApplicationUser_UserId", table: "AspNetUserClaims"); + migrationBuilder.DropForeignKey(name: "FK_IdentityUserLogin_ApplicationUser_UserId", table: "AspNetUserLogins"); + migrationBuilder.DropForeignKey(name: "FK_IdentityUserRole_IdentityRole_RoleId", table: "AspNetUserRoles"); + migrationBuilder.DropForeignKey(name: "FK_IdentityUserRole_ApplicationUser_UserId", table: "AspNetUserRoles"); + migrationBuilder.DropForeignKey(name: "FK_AccountBalance_ApplicationUser_UserId", table: "AccountBalance"); + migrationBuilder.DropForeignKey(name: "FK_BalanceImpact_AccountBalance_BalanceId", table: "BalanceImpact"); + migrationBuilder.DropForeignKey(name: "FK_BookQuery_ApplicationUser_ClientId", table: "BookQuery"); + migrationBuilder.DropForeignKey(name: "FK_BookQuery_PerformerProfile_PerformerId", table: "BookQuery"); + migrationBuilder.DropForeignKey(name: "FK_CircleMember_Circle_CircleId", table: "CircleMember"); + migrationBuilder.DropForeignKey(name: "FK_CircleMember_ApplicationUser_MemberId", table: "CircleMember"); + migrationBuilder.DropForeignKey(name: "FK_Contact_ApplicationUser_OwnerId", table: "Contact"); + migrationBuilder.DropForeignKey(name: "FK_PerformerProfile_Activity_ActivityCode", table: "PerformerProfile"); + migrationBuilder.DropForeignKey(name: "FK_PerformerProfile_Location_OrganizationAddressId", table: "PerformerProfile"); + migrationBuilder.DropForeignKey(name: "FK_PerformerProfile_ApplicationUser_PerformerId", table: "PerformerProfile"); + migrationBuilder.AddForeignKey( + name: "FK_IdentityRoleClaim_IdentityRole_RoleId", + table: "AspNetRoleClaims", + column: "RoleId", + principalTable: "AspNetRoles", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + migrationBuilder.AddForeignKey( + name: "FK_IdentityUserClaim_ApplicationUser_UserId", + table: "AspNetUserClaims", + column: "UserId", + principalTable: "AspNetUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + migrationBuilder.AddForeignKey( + name: "FK_IdentityUserLogin_ApplicationUser_UserId", + table: "AspNetUserLogins", + column: "UserId", + principalTable: "AspNetUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + migrationBuilder.AddForeignKey( + name: "FK_IdentityUserRole_IdentityRole_RoleId", + table: "AspNetUserRoles", + column: "RoleId", + principalTable: "AspNetRoles", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + migrationBuilder.AddForeignKey( + name: "FK_IdentityUserRole_ApplicationUser_UserId", + table: "AspNetUserRoles", + column: "UserId", + principalTable: "AspNetUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + migrationBuilder.AddForeignKey( + name: "FK_AccountBalance_ApplicationUser_UserId", + table: "AccountBalance", + column: "UserId", + principalTable: "AspNetUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + migrationBuilder.AddForeignKey( + name: "FK_BalanceImpact_AccountBalance_BalanceId", + table: "BalanceImpact", + column: "BalanceId", + principalTable: "AccountBalance", + principalColumn: "UserId", + onDelete: ReferentialAction.Restrict); + migrationBuilder.AddForeignKey( + name: "FK_BookQuery_ApplicationUser_ClientId", + table: "BookQuery", + column: "ClientId", + principalTable: "AspNetUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + migrationBuilder.AddForeignKey( + name: "FK_BookQuery_PerformerProfile_PerformerId", + table: "BookQuery", + column: "PerformerId", + principalTable: "PerformerProfile", + principalColumn: "PerformerId", + onDelete: ReferentialAction.Restrict); + migrationBuilder.AddForeignKey( + name: "FK_CircleMember_Circle_CircleId", + table: "CircleMember", + column: "CircleId", + principalTable: "Circle", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + migrationBuilder.AddForeignKey( + name: "FK_CircleMember_ApplicationUser_MemberId", + table: "CircleMember", + column: "MemberId", + principalTable: "AspNetUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + migrationBuilder.AddForeignKey( + name: "FK_Contact_ApplicationUser_OwnerId", + table: "Contact", + column: "OwnerId", + principalTable: "AspNetUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + migrationBuilder.AddForeignKey( + name: "FK_PerformerProfile_Activity_ActivityCode", + table: "PerformerProfile", + column: "ActivityCode", + principalTable: "Activity", + principalColumn: "Code", + onDelete: ReferentialAction.Restrict); + migrationBuilder.AddForeignKey( + name: "FK_PerformerProfile_Location_OrganizationAddressId", + table: "PerformerProfile", + column: "OrganizationAddressId", + principalTable: "Location", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + migrationBuilder.AddForeignKey( + name: "FK_PerformerProfile_ApplicationUser_PerformerId", + table: "PerformerProfile", + column: "PerformerId", + principalTable: "AspNetUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + migrationBuilder.RenameColumn( + name: "Visible", + table: "Blog", + newName: "visible"); + migrationBuilder.RenameColumn( + name: "Title", + table: "Blog", + newName: "title"); + migrationBuilder.RenameColumn( + name: "Rate", + table: "Blog", + newName: "rate"); + migrationBuilder.RenameColumn( + name: "Posted", + table: "Blog", + newName: "posted"); + migrationBuilder.RenameColumn( + name: "Photo", + table: "Blog", + newName: "photo"); + migrationBuilder.RenameColumn( + name: "Modified", + table: "Blog", + newName: "modified"); + } + } +} diff --git a/Yavsc/Migrations/ApplicationDbContextModelSnapshot.cs b/Yavsc/Migrations/ApplicationDbContextModelSnapshot.cs index a9fd75a9..b91906e9 100644 --- a/Yavsc/Migrations/ApplicationDbContextModelSnapshot.cs +++ b/Yavsc/Migrations/ApplicationDbContextModelSnapshot.cs @@ -1,6 +1,8 @@ using System; using Microsoft.Data.Entity; using Microsoft.Data.Entity.Infrastructure; +using Microsoft.Data.Entity.Metadata; +using Microsoft.Data.Entity.Migrations; using Yavsc.Models; namespace Yavsc.Migrations @@ -309,21 +311,21 @@ namespace Yavsc.Migrations b.Property("AuthorId"); - b.Property("bcontent"); + b.Property("Content"); - b.Property("modified"); + b.Property("Modified"); - b.Property("photo"); + b.Property("Photo"); - b.Property("posted") + b.Property("Posted") .ValueGeneratedOnAdd() .HasAnnotation("Relational:GeneratedValueSql", "LOCALTIMESTAMP"); - b.Property("rate"); + b.Property("Rate"); - b.Property("title"); + b.Property("Title"); - b.Property("visible"); + b.Property("Visible"); b.HasKey("Id"); }); diff --git a/Yavsc/Model/ApplicationDbContext.cs b/Yavsc/Model/ApplicationDbContext.cs index c7dcdacc..dc9f1e46 100644 --- a/Yavsc/Model/ApplicationDbContext.cs +++ b/Yavsc/Model/ApplicationDbContext.cs @@ -25,7 +25,7 @@ namespace Yavsc.Models // Add your customizations after calling base.OnModelCreating(builder); builder.Entity().HasKey(x => new { x.OwnerId, x.UserId }); builder.Entity().Property(x=>x.CreationDate).HasDefaultValueSql("LOCALTIMESTAMP"); - builder.Entity().Property(x=>x.posted).HasDefaultValueSql("LOCALTIMESTAMP"); + builder.Entity().Property(x=>x.Posted).HasDefaultValueSql("LOCALTIMESTAMP"); builder.Entity().Property(x=>x.DeclarationDate).HasDefaultValueSql("LOCALTIMESTAMP"); } diff --git a/Yavsc/Model/Blog/Blog.cs b/Yavsc/Model/Blog/Blog.cs index bdce0645..0c413883 100644 --- a/Yavsc/Model/Blog/Blog.cs +++ b/Yavsc/Model/Blog/Blog.cs @@ -9,23 +9,15 @@ namespace Yavsc.Models [Key(), DatabaseGenerated(DatabaseGeneratedOption.Identity)] public long Id { get; set; } - [Display(Name="Content")] - public string bcontent { get; set; } - - [Display(Name="Modified")] - public DateTime modified { get; set; } - [Display(Name="Photo")] - public string photo { get; set; } - [Display(Name="Posted")] - public DateTime posted { get; set; } - [Display(Name="Rate")] - public int rate { get; set; } - [Display(Name="Title")] - public string title { get; set; } + public string Content { get; set; } + public DateTime Modified { get; set; } + public string Photo { get; set; } + public DateTime Posted { get; set; } + public int Rate { get; set; } + public string Title { get; set; } public string AuthorId { get; set; } [ForeignKey("AuthorId")] public ApplicationUser Author { set; get; } - [Display(Name="Visible")] - public bool visible { get; set; } + public bool Visible { get; set; } } } diff --git a/Yavsc/ViewModels/Auth/AuthorisationHandlers.cs b/Yavsc/ViewModels/Auth/AuthorisationHandlers.cs index b45ef507..05e5b0b0 100644 --- a/Yavsc/ViewModels/Auth/AuthorisationHandlers.cs +++ b/Yavsc/ViewModels/Auth/AuthorisationHandlers.cs @@ -72,7 +72,7 @@ public class BlogViewHandler : AuthorizationHandler else if (context.User.Identity.IsAuthenticated) if (resource.AuthorId == context.User.GetUserId()) context.Succeed(requirement); - else if (resource.visible) + else if (resource.Visible) // TODO && ( resource.Circles == null || context.User belongs to resource.Circles ) context.Succeed(requirement); } diff --git a/Yavsc/Views/Blogspot/Create.cshtml b/Yavsc/Views/Blogspot/Create.cshtml index c168ae13..155bb725 100644 --- a/Yavsc/Views/Blogspot/Create.cshtml +++ b/Yavsc/Views/Blogspot/Create.cshtml @@ -13,31 +13,31 @@
- +
- - + +
- +
- - + +
- +
- - +
- +
- +
diff --git a/Yavsc/Views/Blogspot/Delete.cshtml b/Yavsc/Views/Blogspot/Delete.cshtml index 4b987801..83c54c9c 100644 --- a/Yavsc/Views/Blogspot/Delete.cshtml +++ b/Yavsc/Views/Blogspot/Delete.cshtml @@ -1,13 +1,10 @@ @model Yavsc.Models.Blog - - - - - - - Delete - - +@{ + ViewData["Title"] = "Delete"; +} +@section Scripts { + @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); } +}

Are you sure you want to delete this?

@@ -21,46 +18,46 @@ @Model.Author
- @Html.DisplayNameFor(model => model.bcontent) + @Html.DisplayNameFor(model => model.Content)
- @Html.DisplayFor(model => model.bcontent) + @Html.DisplayFor(model => model.Content)
- @Html.DisplayNameFor(model => model.modified) + @Html.DisplayNameFor(model => model.Modified)
- @Html.DisplayFor(model => model.modified) + @Html.DisplayFor(model => model.Modified)
- @Html.DisplayNameFor(model => model.photo) + @Html.DisplayNameFor(model => model.Photo)
- @Html.DisplayFor(model => model.photo) + @Html.DisplayFor(model => model.Photo)
- @Html.DisplayNameFor(model => model.posted) + @Html.DisplayNameFor(model => model.Posted)
- @Html.DisplayFor(model => model.posted) + @Html.DisplayFor(model => model.Posted)
- @Html.DisplayNameFor(model => model.rate) + @Html.DisplayNameFor(model => model.Rate)
- @Html.DisplayFor(model => model.rate) + @Html.DisplayFor(model => model.Rate)
- @Html.DisplayNameFor(model => model.title) + @Html.DisplayNameFor(model => model.Title)
- @Html.DisplayFor(model => model.title) + @Html.DisplayFor(model => model.Title)
- @Html.DisplayNameFor(model => model.visible) + @Html.DisplayNameFor(model => model.Visible)
- @Html.DisplayFor(model => model.visible) + @Html.DisplayFor(model => model.Visible)
@@ -70,9 +67,4 @@ Back to List
-
-@section Scripts { - @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); } -} - - + \ No newline at end of file diff --git a/Yavsc/Views/Blogspot/Details.cshtml b/Yavsc/Views/Blogspot/Details.cshtml index 41b240d5..73f96ad1 100644 --- a/Yavsc/Views/Blogspot/Details.cshtml +++ b/Yavsc/Views/Blogspot/Details.cshtml @@ -9,16 +9,16 @@
- @SR[Html.DisplayNameFor(model => model.title)] + @SR[Html.DisplayNameFor(model => model.Title)]
- @Html.DisplayFor(model => model.title) + @Html.DisplayFor(model => model.Title)
- @SR[Html.DisplayNameFor(model => model.photo)] + @SR[Html.DisplayNameFor(model => model.Photo)]
- @Html.DisplayFor(model => model.photo) + @Html.DisplayFor(model => model.Photo)
@SR["Author"] @@ -30,34 +30,34 @@ @SR["Content"]
-
- @SR[Html.DisplayNameFor(model => model.modified)] + @SR[Html.DisplayNameFor(model => model.Modified)]
- @Html.DisplayFor(model => model.modified) + @Html.DisplayFor(model => model.Modified)
- @SR[Html.DisplayNameFor(model => model.posted)] + @SR[Html.DisplayNameFor(model => model.Posted)]
- @Html.DisplayFor(model => model.posted) + @Html.DisplayFor(model => model.Posted)
- @SR[Html.DisplayNameFor(model => model.rate)] + @SR[Html.DisplayNameFor(model => model.Rate)]
- @Html.DisplayFor(model => model.rate) + @Html.DisplayFor(model => model.Rate)
- @SR[Html.DisplayNameFor(model => model.visible)] + @SR[Html.DisplayNameFor(model => model.Visible)]
- @Html.DisplayFor(model => model.visible) + @Html.DisplayFor(model => model.Visible)
diff --git a/Yavsc/Views/Blogspot/Edit.cshtml b/Yavsc/Views/Blogspot/Edit.cshtml index a2fc8661..1c783df3 100644 --- a/Yavsc/Views/Blogspot/Edit.cshtml +++ b/Yavsc/Views/Blogspot/Edit.cshtml @@ -44,8 +44,8 @@