-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add default constructor to FileData, implement DetachFilesFromContexts
- Loading branch information
1 parent
b8db6e1
commit 63f395b
Showing
12 changed files
with
159 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 4 additions & 1 deletion
5
...ations/20170604105611_Initial.Designer.cs → ...ations/20170607064906_Initial.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
207 changes: 106 additions & 101 deletions
207
Filer.EntityFrameworkCore/Migrations/FileStoreContextModelSnapshot.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,102 +1,107 @@ | ||
namespace Filer.EntityFrameworkCore.Migrations | ||
using System; | ||
using Microsoft.EntityFrameworkCore; | ||
using Microsoft.EntityFrameworkCore.Infrastructure; | ||
using Microsoft.EntityFrameworkCore.Metadata; | ||
using Microsoft.EntityFrameworkCore.Migrations; | ||
using Filer.EntityFrameworkCore; | ||
|
||
namespace Filer.EntityFrameworkCore.Migrations | ||
{ | ||
using System; | ||
using Microsoft.EntityFrameworkCore; | ||
using Microsoft.EntityFrameworkCore.Infrastructure; | ||
using Microsoft.EntityFrameworkCore.Metadata; | ||
|
||
[DbContext(typeof(FileStoreContext))] | ||
partial class FileStoreContextModelSnapshot : ModelSnapshot | ||
{ | ||
protected override void BuildModel(ModelBuilder modelBuilder) | ||
{ | ||
modelBuilder | ||
.HasAnnotation("ProductVersion", "1.1.2") | ||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); | ||
|
||
modelBuilder.Entity("Filer.Core.File", b => | ||
{ | ||
b.Property<int>("Id") | ||
.ValueGeneratedOnAdd() | ||
.HasColumnName("Id"); | ||
|
||
b.Property<byte>("CompressionFormatId") | ||
.HasColumnName("CompressionFormat"); | ||
|
||
b.Property<int?>("CreatedByUserId") | ||
.HasColumnName("CreatedByUserId"); | ||
|
||
b.Property<DateTime>("CreatedOn") | ||
.HasColumnName("CreatedOn"); | ||
|
||
b.Property<string>("Extension") | ||
.HasColumnName("Extension") | ||
.HasMaxLength(20) | ||
.IsUnicode(true); | ||
|
||
b.Property<string>("MimeType") | ||
.HasColumnName("MimeType") | ||
.HasMaxLength(100) | ||
.IsUnicode(false); | ||
|
||
b.Property<string>("Name") | ||
.HasColumnName("Name") | ||
.HasMaxLength(255) | ||
.IsUnicode(true); | ||
|
||
b.Property<long>("Size") | ||
.HasColumnName("Size"); | ||
|
||
b.HasKey("Id"); | ||
|
||
b.HasIndex("CreatedByUserId") | ||
.HasName("IX_File_CreatedByUserId"); | ||
|
||
b.ToTable("File"); | ||
}); | ||
|
||
modelBuilder.Entity("Filer.Core.FileContext", b => | ||
{ | ||
b.Property<int>("FileId") | ||
.HasColumnName("FileId"); | ||
|
||
b.Property<string>("Value") | ||
.HasColumnName("Value") | ||
.HasMaxLength(50) | ||
.IsUnicode(false); | ||
|
||
b.HasKey("FileId", "Value"); | ||
|
||
b.ToTable("FileContext"); | ||
}); | ||
|
||
modelBuilder.Entity("Filer.Core.FileData", b => | ||
{ | ||
b.Property<int>("FileId") | ||
.HasColumnName("Id"); | ||
|
||
b.Property<byte[]>("Data") | ||
.HasColumnName("Data"); | ||
|
||
b.HasKey("FileId"); | ||
|
||
b.ToTable("FileData"); | ||
}); | ||
|
||
modelBuilder.Entity("Filer.Core.FileContext", b => | ||
{ | ||
b.HasOne("Filer.Core.File", "File") | ||
.WithMany("Contexts") | ||
.HasForeignKey("FileId"); | ||
}); | ||
|
||
modelBuilder.Entity("Filer.Core.FileData", b => | ||
{ | ||
b.HasOne("Filer.Core.File") | ||
.WithOne("Data") | ||
.HasForeignKey("Filer.Core.FileData", "FileId") | ||
.OnDelete(DeleteBehavior.Cascade); | ||
}); | ||
} | ||
} | ||
} | ||
[DbContext(typeof(FileStoreContext))] | ||
partial class FileStoreContextModelSnapshot : ModelSnapshot | ||
{ | ||
protected override void BuildModel(ModelBuilder modelBuilder) | ||
{ | ||
modelBuilder | ||
.HasAnnotation("ProductVersion", "1.1.2") | ||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); | ||
|
||
modelBuilder.Entity("Filer.Core.File", b => | ||
{ | ||
b.Property<int>("Id") | ||
.ValueGeneratedOnAdd() | ||
.HasColumnName("Id"); | ||
|
||
b.Property<byte>("CompressionFormatId") | ||
.HasColumnName("CompressionFormat"); | ||
|
||
b.Property<int?>("CreatedByUserId") | ||
.HasColumnName("CreatedByUserId"); | ||
|
||
b.Property<DateTime>("CreatedOn") | ||
.HasColumnName("CreatedOn"); | ||
|
||
b.Property<string>("Extension") | ||
.HasColumnName("Extension") | ||
.HasMaxLength(20) | ||
.IsUnicode(true); | ||
|
||
b.Property<string>("MimeType") | ||
.HasColumnName("MimeType") | ||
.HasMaxLength(100) | ||
.IsUnicode(false); | ||
|
||
b.Property<string>("Name") | ||
.HasColumnName("Name") | ||
.HasMaxLength(255) | ||
.IsUnicode(true); | ||
|
||
b.Property<long>("Size") | ||
.HasColumnName("Size"); | ||
|
||
b.HasKey("Id"); | ||
|
||
b.HasIndex("CreatedByUserId") | ||
.HasName("IX_File_CreatedByUserId"); | ||
|
||
b.ToTable("File"); | ||
}); | ||
|
||
modelBuilder.Entity("Filer.Core.FileContext", b => | ||
{ | ||
b.Property<int>("FileId") | ||
.HasColumnName("FileId"); | ||
|
||
b.Property<string>("Value") | ||
.HasColumnName("Value") | ||
.HasMaxLength(50) | ||
.IsUnicode(false); | ||
|
||
b.HasKey("FileId", "Value"); | ||
|
||
b.HasIndex("Value", "FileId") | ||
.IsUnique(); | ||
|
||
b.ToTable("FileContext"); | ||
}); | ||
|
||
modelBuilder.Entity("Filer.Core.FileData", b => | ||
{ | ||
b.Property<int>("FileId") | ||
.HasColumnName("Id"); | ||
|
||
b.Property<byte[]>("Data") | ||
.HasColumnName("Data"); | ||
|
||
b.HasKey("FileId"); | ||
|
||
b.ToTable("FileData"); | ||
}); | ||
|
||
modelBuilder.Entity("Filer.Core.FileContext", b => | ||
{ | ||
b.HasOne("Filer.Core.File", "File") | ||
.WithMany("Contexts") | ||
.HasForeignKey("FileId"); | ||
}); | ||
|
||
modelBuilder.Entity("Filer.Core.FileData", b => | ||
{ | ||
b.HasOne("Filer.Core.File") | ||
.WithOne("Data") | ||
.HasForeignKey("Filer.Core.FileData", "FileId") | ||
.OnDelete(DeleteBehavior.Cascade); | ||
}); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters