Changed LayoutRecord Guid type to Guid.

This commit is contained in:
Sipke Schoorstra
2015-09-29 21:13:11 +01:00
parent 5d5f55f535
commit 5f40af0f99
4 changed files with 9 additions and 7 deletions

View File

@@ -105,7 +105,7 @@ namespace Orchard.Projections.Controllers {
model.Form = form;
if (ModelState.IsValid) {
var layoutRecord = new LayoutRecord { Guid = Guid.NewGuid().ToString() ,Category = model.Category, Type = model.Type };
var layoutRecord = new LayoutRecord { Guid = Guid.NewGuid() ,Category = model.Category, Type = model.Type };
var query = _queryService.GetQuery(model.QueryId);
query.Layouts.Add(layoutRecord);

View File

@@ -173,7 +173,7 @@ namespace Orchard.Projections.Drivers {
}
return new LayoutRecord {
Guid = guid,
Guid = !String.IsNullOrWhiteSpace(guid) ? Guid.Parse(guid) : Guid.NewGuid(),
Category = category,
Description = layout.Attribute("Description").Value,
Display = int.Parse(layout.Attribute("Display").Value),

View File

@@ -1,4 +1,5 @@
using System.Data;
using System;
using System.Data;
using Orchard.ContentManagement.MetaData;
using Orchard.Core.Common.Models;
using Orchard.Core.Contents.Extensions;
@@ -102,7 +103,7 @@ namespace Orchard.Projections {
SchemaBuilder.CreateTable("LayoutRecord",
table => table
.Column<int>("Id", c => c.PrimaryKey().Identity())
.Column<string>("Guid", c => c.WithLength(64))
.Column<Guid>("Guid")
.Column<string>("Category", c => c.WithLength(64))
.Column<string>("Type", c => c.WithLength(64))
.Column<string>("Description", c => c.WithLength(255))
@@ -279,7 +280,7 @@ namespace Orchard.Projections {
public int UpdateFrom3() {
SchemaBuilder.AlterTable("LayoutRecord", table => table
.AddColumn<string>("Guid", c => c.WithLength(64))
.AddColumn<Guid>("Guid")
);
SchemaBuilder.AlterTable("LayoutRecord", table => table

View File

@@ -1,4 +1,5 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using Orchard.Data.Conventions;
@@ -9,7 +10,7 @@ namespace Orchard.Projections.Models {
}
public virtual int Id { get; set; }
public virtual string Guid { get; set; }
public virtual Guid Guid { get; set; }
public virtual string Description { get; set; }
public virtual string Category { get; set; }
public virtual string Type { get; set; }