repo_name
stringlengths 2
55
| dataset
stringclasses 1
value | owner
stringlengths 3
31
| lang
stringclasses 10
values | func_name
stringlengths 1
104
| code
stringlengths 20
96.7k
| docstring
stringlengths 1
4.92k
| url
stringlengths 94
241
| sha
stringlengths 40
40
|
|---|---|---|---|---|---|---|---|---|
NetAdmin
|
github_2023
|
nsnail
|
csharp
|
ExampleService.BulkDeleteAsync
|
public async Task<int> BulkDeleteAsync(BulkReq<DelReq> req)
{
req.ThrowIfInvalid();
var ret = 0;
// ReSharper disable once LoopCanBeConvertedToQuery
foreach (var item in req.Items) {
ret += await DeleteAsync(item).ConfigureAwait(false);
}
return ret;
}
|
/// <inheritdoc />
|
https://github.com/nsnail/NetAdmin/blob/72cc3c42fded6f2d5a8cc43244746493c346d8f8/src/backend/NetAdmin/NetAdmin.Application/Services/Tpl/ExampleService.cs#L15-L26
|
72cc3c42fded6f2d5a8cc43244746493c346d8f8
|
NetAdmin
|
github_2023
|
nsnail
|
csharp
|
IApplicationBuilderExtensions.UseEndpoints
|
public static IApplicationBuilder UseEndpoints(this IApplicationBuilder me)
{
return me.UseEndpoints(endpoints => {
_ = endpoints.MapControllers();
#if !DEBUG
_ = endpoints.MapMetrics();
#endif
});
}
|
/// <summary>
/// 执行匹配的端点
/// </summary>
|
https://github.com/nsnail/NetAdmin/blob/72cc3c42fded6f2d5a8cc43244746493c346d8f8/src/backend/NetAdmin/NetAdmin.Host/Extensions/IApplicationBuilderExtensions.cs#L22-L30
|
72cc3c42fded6f2d5a8cc43244746493c346d8f8
|
LANCommander
|
github_2023
|
LANCommander
|
csharp
|
RemoveDeprecatedServerHttpOptions.BuildTargetModel
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "7.0.13")
.HasAnnotation("Proxies:ChangeTracking", false)
.HasAnnotation("Proxies:CheckEquality", false)
.HasAnnotation("Proxies:LazyLoading", true);
modelBuilder.Entity("CategoryGame", b =>
{
b.Property<Guid>("CategoriesId")
.HasColumnType("TEXT");
b.Property<Guid>("GamesId")
.HasColumnType("TEXT");
b.HasKey("CategoriesId", "GamesId");
b.HasIndex("GamesId");
b.ToTable("CategoryGame");
});
modelBuilder.Entity("GameDeveloper", b =>
{
b.Property<Guid>("DeveloperId")
.HasColumnType("TEXT");
b.Property<Guid>("GameId")
.HasColumnType("TEXT");
b.HasKey("DeveloperId", "GameId");
b.HasIndex("GameId");
b.ToTable("GameDeveloper");
});
modelBuilder.Entity("GameGenre", b =>
{
b.Property<Guid>("GamesId")
.HasColumnType("TEXT");
b.Property<Guid>("GenresId")
.HasColumnType("TEXT");
b.HasKey("GamesId", "GenresId");
b.HasIndex("GenresId");
b.ToTable("GameGenre");
});
modelBuilder.Entity("GamePublisher", b =>
{
b.Property<Guid>("GameId")
.HasColumnType("TEXT");
b.Property<Guid>("PublisherId")
.HasColumnType("TEXT");
b.HasKey("GameId", "PublisherId");
b.HasIndex("PublisherId");
b.ToTable("GamePublisher");
});
modelBuilder.Entity("GameRedistributable", b =>
{
b.Property<Guid>("GameId")
.HasColumnType("TEXT");
b.Property<Guid>("RedistributableId")
.HasColumnType("TEXT");
b.HasKey("GameId", "RedistributableId");
b.HasIndex("RedistributableId");
b.ToTable("GameRedistributable");
});
modelBuilder.Entity("GameTag", b =>
{
b.Property<Guid>("GamesId")
.HasColumnType("TEXT");
b.Property<Guid>("TagsId")
.HasColumnType("TEXT");
b.HasKey("GamesId", "TagsId");
b.HasIndex("TagsId");
b.ToTable("GameTag");
});
modelBuilder.Entity("LANCommander.Data.Models.Action", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("Arguments")
.HasColumnType("TEXT");
b.Property<Guid?>("CreatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedOn")
.HasColumnType("TEXT");
b.Property<Guid>("GameId")
.HasColumnType("TEXT");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Path")
.HasColumnType("TEXT");
b.Property<bool>("PrimaryAction")
.HasColumnType("INTEGER");
b.Property<int>("SortOrder")
.HasColumnType("INTEGER");
b.Property<Guid?>("UpdatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("UpdatedOn")
.HasColumnType("TEXT");
b.Property<string>("WorkingDirectory")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("CreatedById");
b.HasIndex("GameId");
b.HasIndex("UpdatedById");
b.ToTable("Actions");
});
modelBuilder.Entity("LANCommander.Data.Models.Archive", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("Changelog")
.HasColumnType("TEXT");
b.Property<long>("CompressedSize")
.HasColumnType("INTEGER");
b.Property<Guid?>("CreatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedOn")
.HasColumnType("TEXT");
b.Property<Guid?>("GameId")
.HasColumnType("TEXT");
b.Property<Guid?>("LastVersionId")
.HasColumnType("TEXT");
b.Property<string>("ObjectKey")
.IsRequired()
.HasColumnType("TEXT");
b.Property<Guid?>("RedistributableId")
.HasColumnType("TEXT");
b.Property<long>("UncompressedSize")
.HasColumnType("INTEGER");
b.Property<Guid?>("UpdatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("UpdatedOn")
.HasColumnType("TEXT");
b.Property<string>("Version")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("CreatedById");
b.HasIndex("GameId");
b.HasIndex("LastVersionId");
b.HasIndex("RedistributableId");
b.HasIndex("UpdatedById");
b.ToTable("Archive");
});
modelBuilder.Entity("LANCommander.Data.Models.Category", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<Guid?>("CreatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedOn")
.HasColumnType("TEXT");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.Property<Guid>("ParentId")
.HasColumnType("TEXT");
b.Property<Guid?>("UpdatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("UpdatedOn")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("CreatedById");
b.HasIndex("ParentId");
b.HasIndex("UpdatedById");
b.ToTable("Categories");
});
modelBuilder.Entity("LANCommander.Data.Models.Company", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<Guid?>("CreatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedOn")
.HasColumnType("TEXT");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.Property<Guid?>("UpdatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("UpdatedOn")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("CreatedById");
b.HasIndex("UpdatedById");
b.ToTable("Companies");
});
modelBuilder.Entity("LANCommander.Data.Models.Game", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<Guid?>("CreatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedOn")
.HasColumnType("TEXT");
b.Property<string>("Description")
.HasColumnType("TEXT");
b.Property<string>("DirectoryName")
.HasColumnType("TEXT");
b.Property<long?>("IGDBId")
.HasColumnType("INTEGER");
b.Property<string>("Notes")
.HasColumnType("TEXT");
b.Property<DateTime?>("ReleasedOn")
.HasColumnType("TEXT");
b.Property<bool>("Singleplayer")
.HasColumnType("INTEGER");
b.Property<string>("SortTitle")
.HasColumnType("TEXT");
b.Property<string>("Title")
.IsRequired()
.HasColumnType("TEXT");
b.Property<Guid?>("UpdatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("UpdatedOn")
.HasColumnType("TEXT");
b.Property<string>("ValidKeyRegex")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("CreatedById");
b.HasIndex("UpdatedById");
b.ToTable("Games");
});
modelBuilder.Entity("LANCommander.Data.Models.GameSave", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<Guid?>("CreatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedOn")
.HasColumnType("TEXT");
b.Property<Guid>("GameId")
.HasColumnType("TEXT");
b.Property<Guid?>("UpdatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("UpdatedOn")
.HasColumnType("TEXT");
b.Property<Guid>("UserId")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("CreatedById");
b.HasIndex("GameId");
b.HasIndex("UpdatedById");
b.HasIndex("UserId");
b.ToTable("GameSaves");
});
modelBuilder.Entity("LANCommander.Data.Models.Genre", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<Guid?>("CreatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedOn")
.HasColumnType("TEXT");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.Property<Guid?>("UpdatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("UpdatedOn")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("CreatedById");
b.HasIndex("UpdatedById");
b.ToTable("Genres");
});
modelBuilder.Entity("LANCommander.Data.Models.Key", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<int>("AllocationMethod")
.HasColumnType("INTEGER");
b.Property<string>("ClaimedByComputerName")
.HasMaxLength(255)
.HasColumnType("TEXT");
b.Property<string>("ClaimedByIpv4Address")
.HasMaxLength(15)
.HasColumnType("TEXT");
b.Property<string>("ClaimedByMacAddress")
.HasMaxLength(17)
.HasColumnType("TEXT");
b.Property<Guid?>("ClaimedByUserId")
.HasColumnType("TEXT");
b.Property<DateTime?>("ClaimedOn")
.HasColumnType("TEXT");
b.Property<Guid?>("CreatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedOn")
.HasColumnType("TEXT");
b.Property<Guid>("GameId")
.HasColumnType("TEXT");
b.Property<Guid?>("UpdatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("UpdatedOn")
.HasColumnType("TEXT");
b.Property<string>("Value")
.IsRequired()
.HasMaxLength(255)
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("ClaimedByUserId");
b.HasIndex("CreatedById");
b.HasIndex("GameId");
b.HasIndex("UpdatedById");
b.ToTable("Keys");
});
modelBuilder.Entity("LANCommander.Data.Models.Media", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<Guid?>("CreatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedOn")
.HasColumnType("TEXT");
b.Property<Guid>("FileId")
.HasColumnType("TEXT");
b.Property<Guid>("GameId")
.HasColumnType("TEXT");
b.Property<string>("MimeType")
.IsRequired()
.HasMaxLength(255)
.HasColumnType("TEXT");
b.Property<string>("SourceUrl")
.IsRequired()
.HasMaxLength(2048)
.HasColumnType("TEXT");
b.Property<int>("Type")
.HasColumnType("INTEGER");
b.Property<Guid?>("UpdatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("UpdatedOn")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("CreatedById");
b.HasIndex("GameId");
b.HasIndex("UpdatedById");
b.ToTable("Media");
});
modelBuilder.Entity("LANCommander.Data.Models.MultiplayerMode", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<Guid?>("CreatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedOn")
.HasColumnType("TEXT");
b.Property<string>("Description")
.HasColumnType("TEXT");
b.Property<Guid?>("GameId")
.IsRequired()
.HasColumnType("TEXT");
b.Property<int>("MaxPlayers")
.HasColumnType("INTEGER");
b.Property<int>("MinPlayers")
.HasColumnType("INTEGER");
b.Property<int>("NetworkProtocol")
.HasColumnType("INTEGER");
b.Property<int>("Spectators")
.HasColumnType("INTEGER");
b.Property<int>("Type")
.HasColumnType("INTEGER");
b.Property<Guid?>("UpdatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("UpdatedOn")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("CreatedById");
b.HasIndex("GameId");
b.HasIndex("UpdatedById");
b.ToTable("MultiplayerModes");
});
modelBuilder.Entity("LANCommander.Data.Models.Redistributable", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<Guid?>("CreatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedOn")
.HasColumnType("TEXT");
b.Property<string>("Description")
.HasColumnType("TEXT");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Notes")
.HasColumnType("TEXT");
b.Property<Guid?>("UpdatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("UpdatedOn")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("CreatedById");
b.HasIndex("UpdatedById");
b.ToTable("Redistributables");
});
modelBuilder.Entity("LANCommander.Data.Models.Role", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("TEXT");
b.Property<string>("Name")
.HasMaxLength(256)
.HasColumnType("TEXT");
b.Property<string>("NormalizedName")
.HasMaxLength(256)
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("NormalizedName")
.IsUnique()
.HasDatabaseName("RoleNameIndex");
b.ToTable("AspNetRoles", (string)null);
});
modelBuilder.Entity("LANCommander.Data.Models.SavePath", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<Guid?>("CreatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedOn")
.HasColumnType("TEXT");
b.Property<Guid?>("GameId")
.HasColumnType("TEXT");
b.Property<string>("Path")
.IsRequired()
.HasColumnType("TEXT");
b.Property<int>("Type")
.HasColumnType("INTEGER");
b.Property<Guid?>("UpdatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("UpdatedOn")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("CreatedById");
b.HasIndex("GameId");
b.HasIndex("UpdatedById");
b.ToTable("SavePaths");
});
modelBuilder.Entity("LANCommander.Data.Models.Script", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("Contents")
.IsRequired()
.HasColumnType("TEXT");
b.Property<Guid?>("CreatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedOn")
.HasColumnType("TEXT");
b.Property<string>("Description")
.HasColumnType("TEXT");
b.Property<Guid?>("GameId")
.HasColumnType("TEXT");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.Property<Guid?>("RedistributableId")
.HasColumnType("TEXT");
b.Property<bool>("RequiresAdmin")
.HasColumnType("INTEGER");
b.Property<int>("Type")
.HasColumnType("INTEGER");
b.Property<Guid?>("UpdatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("UpdatedOn")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("CreatedById");
b.HasIndex("GameId");
b.HasIndex("RedistributableId");
b.HasIndex("UpdatedById");
b.ToTable("Scripts");
});
modelBuilder.Entity("LANCommander.Data.Models.Server", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("Arguments")
.IsRequired()
.HasColumnType("TEXT");
b.Property<bool>("Autostart")
.HasColumnType("INTEGER");
b.Property<int>("AutostartDelay")
.HasColumnType("INTEGER");
b.Property<Guid?>("CreatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedOn")
.HasColumnType("TEXT");
b.Property<Guid?>("GameId")
.HasColumnType("TEXT");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("OnStartScriptPath")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("OnStopScriptPath")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Path")
.IsRequired()
.HasColumnType("TEXT");
b.Property<Guid?>("UpdatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("UpdatedOn")
.HasColumnType("TEXT");
b.Property<bool>("UseShellExecute")
.HasColumnType("INTEGER");
b.Property<string>("WorkingDirectory")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("CreatedById");
b.HasIndex("GameId");
b.HasIndex("UpdatedById");
b.ToTable("Servers");
});
modelBuilder.Entity("LANCommander.Data.Models.ServerConsole", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<Guid?>("CreatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedOn")
.HasColumnType("TEXT");
b.Property<string>("Host")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Password")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Path")
.IsRequired()
.HasColumnType("TEXT");
b.Property<int?>("Port")
.HasColumnType("INTEGER");
b.Property<Guid?>("ServerId")
.IsRequired()
.HasColumnType("TEXT");
b.Property<Guid?>("ServerId1")
.HasColumnType("TEXT");
b.Property<int>("Type")
.HasColumnType("INTEGER");
b.Property<Guid?>("UpdatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("UpdatedOn")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("CreatedById");
b.HasIndex("ServerId");
b.HasIndex("ServerId1");
b.HasIndex("UpdatedById");
b.ToTable("ServerConsoles");
});
modelBuilder.Entity("LANCommander.Data.Models.ServerHttpPath", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<Guid?>("CreatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedOn")
.HasColumnType("TEXT");
b.Property<string>("LocalPath")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Path")
.IsRequired()
.HasColumnType("TEXT");
b.Property<Guid>("ServerId")
.HasColumnType("TEXT");
b.Property<Guid?>("ServerId1")
.HasColumnType("TEXT");
b.Property<Guid?>("UpdatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("UpdatedOn")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("CreatedById");
b.HasIndex("ServerId");
b.HasIndex("ServerId1");
b.HasIndex("UpdatedById");
b.ToTable("ServerHttpPath");
});
modelBuilder.Entity("LANCommander.Data.Models.Tag", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<Guid?>("CreatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedOn")
.HasColumnType("TEXT");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.Property<Guid?>("UpdatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("UpdatedOn")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("CreatedById");
b.HasIndex("UpdatedById");
b.ToTable("Tags");
});
modelBuilder.Entity("LANCommander.Data.Models.User", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<int>("AccessFailedCount")
.HasColumnType("INTEGER");
b.Property<string>("Alias")
.HasColumnType("TEXT");
b.Property<bool>("Approved")
.HasColumnType("INTEGER");
b.Property<DateTime?>("ApprovedOn")
.HasColumnType("TEXT");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("TEXT");
b.Property<string>("Email")
.HasMaxLength(256)
.HasColumnType("TEXT");
b.Property<bool>("EmailConfirmed")
.HasColumnType("INTEGER");
b.Property<bool>("LockoutEnabled")
.HasColumnType("INTEGER");
b.Property<DateTimeOffset?>("LockoutEnd")
.HasColumnType("TEXT");
b.Property<string>("NormalizedEmail")
.HasMaxLength(256)
.HasColumnType("TEXT");
b.Property<string>("NormalizedUserName")
.HasMaxLength(256)
.HasColumnType("TEXT");
b.Property<string>("PasswordHash")
.HasColumnType("TEXT");
b.Property<string>("PhoneNumber")
.HasColumnType("TEXT");
b.Property<bool>("PhoneNumberConfirmed")
.HasColumnType("INTEGER");
b.Property<string>("RefreshToken")
.HasColumnType("TEXT");
b.Property<DateTime>("RefreshTokenExpiration")
.HasColumnType("TEXT");
b.Property<string>("SecurityStamp")
.HasColumnType("TEXT");
b.Property<bool>("TwoFactorEnabled")
.HasColumnType("INTEGER");
b.Property<string>("UserName")
.HasMaxLength(256)
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("NormalizedEmail")
.HasDatabaseName("EmailIndex");
b.HasIndex("NormalizedUserName")
.IsUnique()
.HasDatabaseName("UserNameIndex");
b.ToTable("AspNetUsers", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<System.Guid>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("ClaimType")
.HasColumnType("TEXT");
b.Property<string>("ClaimValue")
.HasColumnType("TEXT");
b.Property<Guid>("RoleId")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("RoleId");
b.ToTable("AspNetRoleClaims", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<System.Guid>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("ClaimType")
.HasColumnType("TEXT");
b.Property<string>("ClaimValue")
.HasColumnType("TEXT");
b.Property<Guid>("UserId")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("UserId");
b.ToTable("AspNetUserClaims", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<System.Guid>", b =>
{
b.Property<string>("LoginProvider")
.HasMaxLength(128)
.HasColumnType("TEXT");
b.Property<string>("ProviderKey")
.HasMaxLength(128)
.HasColumnType("TEXT");
b.Property<string>("ProviderDisplayName")
.HasColumnType("TEXT");
b.Property<Guid>("UserId")
.HasColumnType("TEXT");
b.HasKey("LoginProvider", "ProviderKey");
b.HasIndex("UserId");
b.ToTable("AspNetUserLogins", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<System.Guid>", b =>
{
b.Property<Guid>("UserId")
.HasColumnType("TEXT");
b.Property<Guid>("RoleId")
.HasColumnType("TEXT");
b.HasKey("UserId", "RoleId");
b.HasIndex("RoleId");
b.ToTable("AspNetUserRoles", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<System.Guid>", b =>
{
b.Property<Guid>("UserId")
.HasColumnType("TEXT");
b.Property<string>("LoginProvider")
.HasMaxLength(128)
.HasColumnType("TEXT");
b.Property<string>("Name")
.HasMaxLength(128)
.HasColumnType("TEXT");
b.Property<string>("Value")
.HasColumnType("TEXT");
b.HasKey("UserId", "LoginProvider", "Name");
b.ToTable("AspNetUserTokens", (string)null);
});
modelBuilder.Entity("CategoryGame", b =>
{
b.HasOne("LANCommander.Data.Models.Category", null)
.WithMany()
.HasForeignKey("CategoriesId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("LANCommander.Data.Models.Game", null)
.WithMany()
.HasForeignKey("GamesId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("GameDeveloper", b =>
{
b.HasOne("LANCommander.Data.Models.Company", null)
.WithMany()
.HasForeignKey("DeveloperId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("LANCommander.Data.Models.Game", null)
.WithMany()
.HasForeignKey("GameId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("GameGenre", b =>
{
b.HasOne("LANCommander.Data.Models.Game", null)
.WithMany()
.HasForeignKey("GamesId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("LANCommander.Data.Models.Genre", null)
.WithMany()
.HasForeignKey("GenresId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("GamePublisher", b =>
{
b.HasOne("LANCommander.Data.Models.Game", null)
.WithMany()
.HasForeignKey("GameId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("LANCommander.Data.Models.Company", null)
.WithMany()
.HasForeignKey("PublisherId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("GameRedistributable", b =>
{
b.HasOne("LANCommander.Data.Models.Game", null)
.WithMany()
.HasForeignKey("GameId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("LANCommander.Data.Models.Redistributable", null)
.WithMany()
.HasForeignKey("RedistributableId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("GameTag", b =>
{
b.HasOne("LANCommander.Data.Models.Game", null)
.WithMany()
.HasForeignKey("GamesId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("LANCommander.Data.Models.Tag", null)
.WithMany()
.HasForeignKey("TagsId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("LANCommander.Data.Models.Action", b =>
{
b.HasOne("LANCommander.Data.Models.User", "CreatedBy")
.WithMany()
.HasForeignKey("CreatedById");
b.HasOne("LANCommander.Data.Models.Game", "Game")
.WithMany("Actions")
.HasForeignKey("GameId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("LANCommander.Data.Models.User", "UpdatedBy")
.WithMany()
.HasForeignKey("UpdatedById");
b.Navigation("CreatedBy");
b.Navigation("Game");
b.Navigation("UpdatedBy");
});
modelBuilder.Entity("LANCommander.Data.Models.Archive", b =>
{
b.HasOne("LANCommander.Data.Models.User", "CreatedBy")
.WithMany()
.HasForeignKey("CreatedById");
b.HasOne("LANCommander.Data.Models.Game", "Game")
.WithMany("Archives")
.HasForeignKey("GameId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("LANCommander.Data.Models.Archive", "LastVersion")
.WithMany()
.HasForeignKey("LastVersionId");
b.HasOne("LANCommander.Data.Models.Redistributable", "Redistributable")
.WithMany("Archives")
.HasForeignKey("RedistributableId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("LANCommander.Data.Models.User", "UpdatedBy")
.WithMany()
.HasForeignKey("UpdatedById");
b.Navigation("CreatedBy");
b.Navigation("Game");
b.Navigation("LastVersion");
b.Navigation("Redistributable");
b.Navigation("UpdatedBy");
});
modelBuilder.Entity("LANCommander.Data.Models.Category", b =>
{
b.HasOne("LANCommander.Data.Models.User", "CreatedBy")
.WithMany()
.HasForeignKey("CreatedById");
b.HasOne("LANCommander.Data.Models.Category", "Parent")
.WithMany("Children")
.HasForeignKey("ParentId");
b.HasOne("LANCommander.Data.Models.User", "UpdatedBy")
.WithMany()
.HasForeignKey("UpdatedById");
b.Navigation("CreatedBy");
b.Navigation("Parent");
b.Navigation("UpdatedBy");
});
modelBuilder.Entity("LANCommander.Data.Models.Company", b =>
{
b.HasOne("LANCommander.Data.Models.User", "CreatedBy")
.WithMany()
.HasForeignKey("CreatedById");
b.HasOne("LANCommander.Data.Models.User", "UpdatedBy")
.WithMany()
.HasForeignKey("UpdatedById");
b.Navigation("CreatedBy");
b.Navigation("UpdatedBy");
});
modelBuilder.Entity("LANCommander.Data.Models.Game", b =>
{
b.HasOne("LANCommander.Data.Models.User", "CreatedBy")
.WithMany()
.HasForeignKey("CreatedById");
b.HasOne("LANCommander.Data.Models.User", "UpdatedBy")
.WithMany()
.HasForeignKey("UpdatedById");
b.Navigation("CreatedBy");
b.Navigation("UpdatedBy");
});
modelBuilder.Entity("LANCommander.Data.Models.GameSave", b =>
{
b.HasOne("LANCommander.Data.Models.User", "CreatedBy")
.WithMany()
.HasForeignKey("CreatedById");
b.HasOne("LANCommander.Data.Models.Game", "Game")
.WithMany("GameSaves")
.HasForeignKey("GameId")
.OnDelete(DeleteBehavior.NoAction)
.IsRequired();
b.HasOne("LANCommander.Data.Models.User", "UpdatedBy")
.WithMany()
.HasForeignKey("UpdatedById");
b.HasOne("LANCommander.Data.Models.User", "User")
.WithMany("GameSaves")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CreatedBy");
b.Navigation("Game");
b.Navigation("UpdatedBy");
b.Navigation("User");
});
modelBuilder.Entity("LANCommander.Data.Models.Genre", b =>
{
b.HasOne("LANCommander.Data.Models.User", "CreatedBy")
.WithMany()
.HasForeignKey("CreatedById");
b.HasOne("LANCommander.Data.Models.User", "UpdatedBy")
.WithMany()
.HasForeignKey("UpdatedById");
b.Navigation("CreatedBy");
b.Navigation("UpdatedBy");
});
modelBuilder.Entity("LANCommander.Data.Models.Key", b =>
{
b.HasOne("LANCommander.Data.Models.User", "ClaimedByUser")
.WithMany()
.HasForeignKey("ClaimedByUserId");
b.HasOne("LANCommander.Data.Models.User", "CreatedBy")
.WithMany()
.HasForeignKey("CreatedById");
b.HasOne("LANCommander.Data.Models.Game", "Game")
.WithMany("Keys")
.HasForeignKey("GameId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("LANCommander.Data.Models.User", "UpdatedBy")
.WithMany()
.HasForeignKey("UpdatedById");
b.Navigation("ClaimedByUser");
b.Navigation("CreatedBy");
b.Navigation("Game");
b.Navigation("UpdatedBy");
});
modelBuilder.Entity("LANCommander.Data.Models.Media", b =>
{
b.HasOne("LANCommander.Data.Models.User", "CreatedBy")
.WithMany()
.HasForeignKey("CreatedById");
b.HasOne("LANCommander.Data.Models.Game", "Game")
.WithMany("Media")
.HasForeignKey("GameId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("LANCommander.Data.Models.User", "UpdatedBy")
.WithMany()
.HasForeignKey("UpdatedById");
b.Navigation("CreatedBy");
b.Navigation("Game");
b.Navigation("UpdatedBy");
});
modelBuilder.Entity("LANCommander.Data.Models.MultiplayerMode", b =>
{
b.HasOne("LANCommander.Data.Models.User", "CreatedBy")
.WithMany()
.HasForeignKey("CreatedById");
b.HasOne("LANCommander.Data.Models.Game", "Game")
.WithMany("MultiplayerModes")
.HasForeignKey("GameId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("LANCommander.Data.Models.User", "UpdatedBy")
.WithMany()
.HasForeignKey("UpdatedById");
b.Navigation("CreatedBy");
b.Navigation("Game");
b.Navigation("UpdatedBy");
});
modelBuilder.Entity("LANCommander.Data.Models.Redistributable", b =>
{
b.HasOne("LANCommander.Data.Models.User", "CreatedBy")
.WithMany()
.HasForeignKey("CreatedById");
b.HasOne("LANCommander.Data.Models.User", "UpdatedBy")
.WithMany()
.HasForeignKey("UpdatedById");
b.Navigation("CreatedBy");
b.Navigation("UpdatedBy");
});
modelBuilder.Entity("LANCommander.Data.Models.SavePath", b =>
{
b.HasOne("LANCommander.Data.Models.User", "CreatedBy")
.WithMany()
.HasForeignKey("CreatedById");
b.HasOne("LANCommander.Data.Models.Game", "Game")
.WithMany("SavePaths")
.HasForeignKey("GameId");
b.HasOne("LANCommander.Data.Models.User", "UpdatedBy")
.WithMany()
.HasForeignKey("UpdatedById");
b.Navigation("CreatedBy");
b.Navigation("Game");
b.Navigation("UpdatedBy");
});
modelBuilder.Entity("LANCommander.Data.Models.Script", b =>
{
b.HasOne("LANCommander.Data.Models.User", "CreatedBy")
.WithMany()
.HasForeignKey("CreatedById");
b.HasOne("LANCommander.Data.Models.Game", "Game")
.WithMany("Scripts")
.HasForeignKey("GameId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("LANCommander.Data.Models.Redistributable", "Redistributable")
.WithMany("Scripts")
.HasForeignKey("RedistributableId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("LANCommander.Data.Models.User", "UpdatedBy")
.WithMany()
.HasForeignKey("UpdatedById");
b.Navigation("CreatedBy");
b.Navigation("Game");
b.Navigation("Redistributable");
b.Navigation("UpdatedBy");
});
modelBuilder.Entity("LANCommander.Data.Models.Server", b =>
{
b.HasOne("LANCommander.Data.Models.User", "CreatedBy")
.WithMany()
.HasForeignKey("CreatedById");
b.HasOne("LANCommander.Data.Models.Game", "Game")
.WithMany("Servers")
.HasForeignKey("GameId")
.OnDelete(DeleteBehavior.NoAction);
b.HasOne("LANCommander.Data.Models.User", "UpdatedBy")
.WithMany()
.HasForeignKey("UpdatedById");
b.Navigation("CreatedBy");
b.Navigation("Game");
b.Navigation("UpdatedBy");
});
modelBuilder.Entity("LANCommander.Data.Models.ServerConsole", b =>
{
b.HasOne("LANCommander.Data.Models.User", "CreatedBy")
.WithMany()
.HasForeignKey("CreatedById");
b.HasOne("LANCommander.Data.Models.Server", "Server")
.WithMany()
.HasForeignKey("ServerId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("LANCommander.Data.Models.Server", null)
.WithMany("ServerConsoles")
.HasForeignKey("ServerId1");
b.HasOne("LANCommander.Data.Models.User", "UpdatedBy")
.WithMany()
.HasForeignKey("UpdatedById");
b.Navigation("CreatedBy");
b.Navigation("Server");
b.Navigation("UpdatedBy");
});
modelBuilder.Entity("LANCommander.Data.Models.ServerHttpPath", b =>
{
b.HasOne("LANCommander.Data.Models.User", "CreatedBy")
.WithMany()
.HasForeignKey("CreatedById");
b.HasOne("LANCommander.Data.Models.Server", "Server")
.WithMany()
.HasForeignKey("ServerId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("LANCommander.Data.Models.Server", null)
.WithMany("HttpPaths")
.HasForeignKey("ServerId1");
b.HasOne("LANCommander.Data.Models.User", "UpdatedBy")
.WithMany()
.HasForeignKey("UpdatedById");
b.Navigation("CreatedBy");
b.Navigation("Server");
b.Navigation("UpdatedBy");
});
modelBuilder.Entity("LANCommander.Data.Models.Tag", b =>
{
b.HasOne("LANCommander.Data.Models.User", "CreatedBy")
.WithMany()
.HasForeignKey("CreatedById");
b.HasOne("LANCommander.Data.Models.User", "UpdatedBy")
.WithMany()
.HasForeignKey("UpdatedById");
b.Navigation("CreatedBy");
b.Navigation("UpdatedBy");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<System.Guid>", b =>
{
b.HasOne("LANCommander.Data.Models.Role", null)
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<System.Guid>", b =>
{
b.HasOne("LANCommander.Data.Models.User", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<System.Guid>", b =>
{
b.HasOne("LANCommander.Data.Models.User", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<System.Guid>", b =>
{
b.HasOne("LANCommander.Data.Models.Role", null)
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("LANCommander.Data.Models.User", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<System.Guid>", b =>
{
b.HasOne("LANCommander.Data.Models.User", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("LANCommander.Data.Models.Category", b =>
{
b.Navigation("Children");
});
modelBuilder.Entity("LANCommander.Data.Models.Game", b =>
{
b.Navigation("Actions");
b.Navigation("Archives");
b.Navigation("GameSaves");
b.Navigation("Keys");
b.Navigation("Media");
b.Navigation("MultiplayerModes");
b.Navigation("SavePaths");
b.Navigation("Scripts");
b.Navigation("Servers");
});
modelBuilder.Entity("LANCommander.Data.Models.Redistributable", b =>
{
b.Navigation("Archives");
b.Navigation("Scripts");
});
modelBuilder.Entity("LANCommander.Data.Models.Server", b =>
{
b.Navigation("HttpPaths");
b.Navigation("ServerConsoles");
});
modelBuilder.Entity("LANCommander.Data.Models.User", b =>
{
b.Navigation("GameSaves");
});
#pragma warning restore 612, 618
}
|
/// <inheritdoc />
|
https://github.com/LANCommander/LANCommander/blob/51bc43ac93e3008391a2c78f958cbfc1d108bd80/LANCommander.Server.Data.SQLite/Migrations/20231105210731_RemoveDeprecatedServerHttpOptions.Designer.cs#L18-L1689
|
51bc43ac93e3008391a2c78f958cbfc1d108bd80
|
LANCommander
|
github_2023
|
LANCommander
|
csharp
|
AddGameCustomFields.BuildTargetModel
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "8.0.10");
modelBuilder.Entity("CategoryGame", b =>
{
b.Property<Guid>("CategoriesId")
.HasColumnType("TEXT");
b.Property<Guid>("GamesId")
.HasColumnType("TEXT");
b.HasKey("CategoriesId", "GamesId");
b.HasIndex("GamesId");
b.ToTable("CategoryGame");
});
modelBuilder.Entity("CollectionGame", b =>
{
b.Property<Guid>("CollectionId")
.HasColumnType("TEXT");
b.Property<Guid>("GameId")
.HasColumnType("TEXT");
b.HasKey("CollectionId", "GameId");
b.HasIndex("GameId");
b.ToTable("CollectionGame");
});
modelBuilder.Entity("GameDeveloper", b =>
{
b.Property<Guid>("GameId")
.HasColumnType("TEXT");
b.Property<Guid>("DeveloperId")
.HasColumnType("TEXT");
b.HasKey("GameId", "DeveloperId");
b.HasIndex("DeveloperId");
b.ToTable("GameDeveloper");
});
modelBuilder.Entity("GameGenre", b =>
{
b.Property<Guid>("GamesId")
.HasColumnType("TEXT");
b.Property<Guid>("GenresId")
.HasColumnType("TEXT");
b.HasKey("GamesId", "GenresId");
b.HasIndex("GenresId");
b.ToTable("GameGenre");
});
modelBuilder.Entity("GamePlatform", b =>
{
b.Property<Guid>("GamesId")
.HasColumnType("TEXT");
b.Property<Guid>("PlatformsId")
.HasColumnType("TEXT");
b.HasKey("GamesId", "PlatformsId");
b.HasIndex("PlatformsId");
b.ToTable("GamePlatform");
});
modelBuilder.Entity("GamePublisher", b =>
{
b.Property<Guid>("GameId")
.HasColumnType("TEXT");
b.Property<Guid>("PublisherId")
.HasColumnType("TEXT");
b.HasKey("GameId", "PublisherId");
b.HasIndex("PublisherId");
b.ToTable("GamePublisher");
});
modelBuilder.Entity("GameRedistributable", b =>
{
b.Property<Guid>("GameId")
.HasColumnType("TEXT");
b.Property<Guid>("RedistributableId")
.HasColumnType("TEXT");
b.HasKey("GameId", "RedistributableId");
b.HasIndex("RedistributableId");
b.ToTable("GameRedistributable");
});
modelBuilder.Entity("GameTag", b =>
{
b.Property<Guid>("GamesId")
.HasColumnType("TEXT");
b.Property<Guid>("TagsId")
.HasColumnType("TEXT");
b.HasKey("GamesId", "TagsId");
b.HasIndex("TagsId");
b.ToTable("GameTag");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.Action", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("Arguments")
.HasColumnType("TEXT");
b.Property<Guid?>("CreatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedOn")
.HasColumnType("TEXT");
b.Property<Guid?>("GameId")
.HasColumnType("TEXT");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Path")
.HasColumnType("TEXT");
b.Property<bool>("PrimaryAction")
.HasColumnType("INTEGER");
b.Property<Guid?>("ServerId")
.HasColumnType("TEXT");
b.Property<int>("SortOrder")
.HasColumnType("INTEGER");
b.Property<Guid?>("UpdatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("UpdatedOn")
.HasColumnType("TEXT");
b.Property<string>("WorkingDirectory")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("CreatedById");
b.HasIndex("GameId");
b.HasIndex("ServerId");
b.HasIndex("UpdatedById");
b.ToTable("Actions");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.Archive", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("Changelog")
.HasColumnType("TEXT");
b.Property<long>("CompressedSize")
.HasColumnType("INTEGER");
b.Property<Guid?>("CreatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedOn")
.HasColumnType("TEXT");
b.Property<Guid?>("GameId")
.HasColumnType("TEXT");
b.Property<Guid?>("LastVersionId")
.HasColumnType("TEXT");
b.Property<string>("ObjectKey")
.IsRequired()
.HasColumnType("TEXT");
b.Property<Guid?>("RedistributableId")
.HasColumnType("TEXT");
b.Property<Guid>("StorageLocationId")
.HasColumnType("TEXT");
b.Property<long>("UncompressedSize")
.HasColumnType("INTEGER");
b.Property<Guid?>("UpdatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("UpdatedOn")
.HasColumnType("TEXT");
b.Property<string>("Version")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("CreatedById");
b.HasIndex("GameId");
b.HasIndex("LastVersionId");
b.HasIndex("RedistributableId");
b.HasIndex("StorageLocationId");
b.HasIndex("UpdatedById");
b.ToTable("Archive");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.Category", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<Guid?>("CreatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedOn")
.HasColumnType("TEXT");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.Property<Guid>("ParentId")
.HasColumnType("TEXT");
b.Property<Guid?>("UpdatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("UpdatedOn")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("CreatedById");
b.HasIndex("ParentId");
b.HasIndex("UpdatedById");
b.ToTable("Categories");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.Collection", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<Guid?>("CreatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedOn")
.HasColumnType("TEXT");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.Property<Guid?>("UpdatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("UpdatedOn")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("CreatedById");
b.HasIndex("UpdatedById");
b.ToTable("Collections");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.Company", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<Guid?>("CreatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedOn")
.HasColumnType("TEXT");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.Property<Guid?>("UpdatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("UpdatedOn")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("CreatedById");
b.HasIndex("UpdatedById");
b.ToTable("Companies");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.Engine", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<Guid?>("CreatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedOn")
.HasColumnType("TEXT");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.Property<Guid?>("UpdatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("UpdatedOn")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("CreatedById");
b.HasIndex("UpdatedById");
b.ToTable("Engines");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.Game", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<Guid?>("BaseGameId")
.HasColumnType("TEXT");
b.Property<Guid?>("CreatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedOn")
.HasColumnType("TEXT");
b.Property<string>("Description")
.HasColumnType("TEXT");
b.Property<string>("DirectoryName")
.HasColumnType("TEXT");
b.Property<Guid?>("EngineId")
.HasColumnType("TEXT");
b.Property<long?>("IGDBId")
.HasColumnType("INTEGER");
b.Property<int>("KeyAllocationMethod")
.HasColumnType("INTEGER");
b.Property<string>("Notes")
.HasColumnType("TEXT");
b.Property<DateTime?>("ReleasedOn")
.HasColumnType("TEXT");
b.Property<bool>("Singleplayer")
.HasColumnType("INTEGER");
b.Property<string>("SortTitle")
.HasColumnType("TEXT");
b.Property<string>("Title")
.IsRequired()
.HasColumnType("TEXT");
b.Property<int>("Type")
.HasColumnType("INTEGER");
b.Property<Guid?>("UpdatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("UpdatedOn")
.HasColumnType("TEXT");
b.Property<string>("ValidKeyRegex")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("BaseGameId");
b.HasIndex("CreatedById");
b.HasIndex("EngineId");
b.HasIndex("UpdatedById");
b.ToTable("Games");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.GameCustomField", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<Guid?>("CreatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedOn")
.HasColumnType("TEXT");
b.Property<Guid?>("GameId")
.HasColumnType("TEXT");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("TEXT");
b.Property<Guid?>("UpdatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("UpdatedOn")
.HasColumnType("TEXT");
b.Property<string>("Value")
.IsRequired()
.HasMaxLength(1024)
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("CreatedById");
b.HasIndex("GameId");
b.HasIndex("UpdatedById");
b.ToTable("GameCustomField");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.GameSave", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<Guid?>("CreatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedOn")
.HasColumnType("TEXT");
b.Property<Guid?>("GameId")
.HasColumnType("TEXT");
b.Property<long>("Size")
.HasColumnType("INTEGER");
b.Property<Guid>("StorageLocationId")
.HasColumnType("TEXT");
b.Property<Guid?>("UpdatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("UpdatedOn")
.HasColumnType("TEXT");
b.Property<Guid>("UserId")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("CreatedById");
b.HasIndex("GameId");
b.HasIndex("StorageLocationId");
b.HasIndex("UpdatedById");
b.HasIndex("UserId");
b.ToTable("GameSaves");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.Genre", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<Guid?>("CreatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedOn")
.HasColumnType("TEXT");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.Property<Guid?>("UpdatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("UpdatedOn")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("CreatedById");
b.HasIndex("UpdatedById");
b.ToTable("Genres");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.Issue", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<Guid?>("CreatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedOn")
.HasColumnType("TEXT");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("TEXT");
b.Property<Guid>("GameId")
.HasColumnType("TEXT");
b.Property<Guid?>("ResolvedById")
.HasColumnType("TEXT");
b.Property<DateTime?>("ResolvedOn")
.HasColumnType("TEXT");
b.Property<Guid?>("UpdatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("UpdatedOn")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("CreatedById");
b.HasIndex("GameId");
b.HasIndex("ResolvedById");
b.HasIndex("UpdatedById");
b.ToTable("Issues");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.Key", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<int>("AllocationMethod")
.HasColumnType("INTEGER");
b.Property<string>("ClaimedByComputerName")
.HasMaxLength(255)
.HasColumnType("TEXT");
b.Property<string>("ClaimedByIpv4Address")
.HasMaxLength(15)
.HasColumnType("TEXT");
b.Property<string>("ClaimedByMacAddress")
.HasMaxLength(17)
.HasColumnType("TEXT");
b.Property<Guid?>("ClaimedByUserId")
.HasColumnType("TEXT");
b.Property<DateTime?>("ClaimedOn")
.HasColumnType("TEXT");
b.Property<Guid?>("CreatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedOn")
.HasColumnType("TEXT");
b.Property<Guid>("GameId")
.HasColumnType("TEXT");
b.Property<Guid?>("UpdatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("UpdatedOn")
.HasColumnType("TEXT");
b.Property<string>("Value")
.IsRequired()
.HasMaxLength(255)
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("ClaimedByUserId");
b.HasIndex("CreatedById");
b.HasIndex("GameId");
b.HasIndex("UpdatedById");
b.ToTable("Keys");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.Library", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<Guid?>("CreatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedOn")
.HasColumnType("TEXT");
b.Property<Guid?>("UpdatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("UpdatedOn")
.HasColumnType("TEXT");
b.Property<Guid>("UserId")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("CreatedById");
b.HasIndex("UpdatedById");
b.HasIndex("UserId")
.IsUnique();
b.ToTable("Libraries");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.Media", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("Crc32")
.IsRequired()
.HasMaxLength(8)
.HasColumnType("TEXT");
b.Property<Guid?>("CreatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedOn")
.HasColumnType("TEXT");
b.Property<Guid>("FileId")
.HasColumnType("TEXT");
b.Property<Guid?>("GameId")
.HasColumnType("TEXT");
b.Property<string>("MimeType")
.HasMaxLength(255)
.HasColumnType("TEXT");
b.Property<string>("Name")
.HasMaxLength(64)
.HasColumnType("TEXT");
b.Property<string>("SourceUrl")
.HasMaxLength(2048)
.HasColumnType("TEXT");
b.Property<Guid>("StorageLocationId")
.HasColumnType("TEXT");
b.Property<Guid?>("ThumbnailId")
.HasColumnType("TEXT");
b.Property<int>("Type")
.HasColumnType("INTEGER");
b.Property<Guid?>("UpdatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("UpdatedOn")
.HasColumnType("TEXT");
b.Property<Guid?>("UserId")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("CreatedById");
b.HasIndex("GameId");
b.HasIndex("StorageLocationId");
b.HasIndex("ThumbnailId")
.IsUnique();
b.HasIndex("UpdatedById");
b.HasIndex("UserId");
b.ToTable("Media");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.MultiplayerMode", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<Guid?>("CreatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedOn")
.HasColumnType("TEXT");
b.Property<string>("Description")
.HasColumnType("TEXT");
b.Property<Guid?>("GameId")
.IsRequired()
.HasColumnType("TEXT");
b.Property<int>("MaxPlayers")
.HasColumnType("INTEGER");
b.Property<int>("MinPlayers")
.HasColumnType("INTEGER");
b.Property<int>("NetworkProtocol")
.HasColumnType("INTEGER");
b.Property<int>("Spectators")
.HasColumnType("INTEGER");
b.Property<int>("Type")
.HasColumnType("INTEGER");
b.Property<Guid?>("UpdatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("UpdatedOn")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("CreatedById");
b.HasIndex("GameId");
b.HasIndex("UpdatedById");
b.ToTable("MultiplayerModes");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.Page", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("Contents")
.IsRequired()
.HasColumnType("TEXT");
b.Property<Guid?>("CreatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedOn")
.HasColumnType("TEXT");
b.Property<Guid?>("ParentId")
.HasColumnType("TEXT");
b.Property<string>("Route")
.IsRequired()
.HasMaxLength(2048)
.HasColumnType("TEXT");
b.Property<string>("Slug")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("TEXT");
b.Property<int>("SortOrder")
.HasColumnType("INTEGER");
b.Property<string>("Title")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("TEXT");
b.Property<Guid?>("UpdatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("UpdatedOn")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("CreatedById");
b.HasIndex("ParentId");
b.HasIndex("UpdatedById");
b.ToTable("Pages");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.Platform", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<Guid?>("CreatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedOn")
.HasColumnType("TEXT");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.Property<Guid?>("UpdatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("UpdatedOn")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("CreatedById");
b.HasIndex("UpdatedById");
b.ToTable("Platforms");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.PlaySession", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<Guid?>("CreatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedOn")
.HasColumnType("TEXT");
b.Property<DateTime?>("End")
.HasColumnType("TEXT");
b.Property<Guid?>("GameId")
.HasColumnType("TEXT");
b.Property<DateTime?>("Start")
.HasColumnType("TEXT");
b.Property<Guid?>("UpdatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("UpdatedOn")
.HasColumnType("TEXT");
b.Property<Guid>("UserId")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("CreatedById");
b.HasIndex("GameId");
b.HasIndex("UpdatedById");
b.HasIndex("UserId");
b.ToTable("PlaySessions");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.Redistributable", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<Guid?>("CreatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedOn")
.HasColumnType("TEXT");
b.Property<string>("Description")
.HasColumnType("TEXT");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Notes")
.HasColumnType("TEXT");
b.Property<Guid?>("UpdatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("UpdatedOn")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("CreatedById");
b.HasIndex("UpdatedById");
b.ToTable("Redistributables");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.Role", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("TEXT");
b.Property<Guid?>("CreatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedOn")
.HasColumnType("TEXT");
b.Property<string>("Name")
.HasMaxLength(256)
.HasColumnType("TEXT");
b.Property<string>("NormalizedName")
.HasMaxLength(256)
.HasColumnType("TEXT");
b.Property<Guid?>("UpdatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("UpdatedOn")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("CreatedById");
b.HasIndex("NormalizedName")
.IsUnique()
.HasDatabaseName("RoleNameIndex");
b.HasIndex("UpdatedById");
b.ToTable("Roles", (string)null);
});
modelBuilder.Entity("LANCommander.Server.Data.Models.SavePath", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<Guid?>("CreatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedOn")
.HasColumnType("TEXT");
b.Property<Guid?>("GameId")
.HasColumnType("TEXT");
b.Property<bool>("IsRegex")
.HasColumnType("INTEGER");
b.Property<string>("Path")
.IsRequired()
.HasColumnType("TEXT");
b.Property<int>("Type")
.HasColumnType("INTEGER");
b.Property<Guid?>("UpdatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("UpdatedOn")
.HasColumnType("TEXT");
b.Property<string>("WorkingDirectory")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("CreatedById");
b.HasIndex("GameId");
b.HasIndex("UpdatedById");
b.ToTable("SavePaths");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.Script", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("Contents")
.IsRequired()
.HasColumnType("TEXT");
b.Property<Guid?>("CreatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedOn")
.HasColumnType("TEXT");
b.Property<string>("Description")
.HasColumnType("TEXT");
b.Property<Guid?>("GameId")
.HasColumnType("TEXT");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.Property<Guid?>("RedistributableId")
.HasColumnType("TEXT");
b.Property<bool>("RequiresAdmin")
.HasColumnType("INTEGER");
b.Property<Guid?>("ServerId")
.HasColumnType("TEXT");
b.Property<int>("Type")
.HasColumnType("INTEGER");
b.Property<Guid?>("UpdatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("UpdatedOn")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("CreatedById");
b.HasIndex("GameId");
b.HasIndex("RedistributableId");
b.HasIndex("ServerId");
b.HasIndex("UpdatedById");
b.ToTable("Scripts");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.Server", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("Arguments")
.IsRequired()
.HasColumnType("TEXT");
b.Property<bool>("Autostart")
.HasColumnType("INTEGER");
b.Property<int>("AutostartDelay")
.HasColumnType("INTEGER");
b.Property<int>("AutostartMethod")
.HasColumnType("INTEGER");
b.Property<Guid?>("CreatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedOn")
.HasColumnType("TEXT");
b.Property<Guid?>("GameId")
.HasColumnType("TEXT");
b.Property<string>("Host")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("OnStartScriptPath")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("OnStopScriptPath")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Path")
.IsRequired()
.HasColumnType("TEXT");
b.Property<int>("Port")
.HasColumnType("INTEGER");
b.Property<int>("ProcessTerminationMethod")
.HasColumnType("INTEGER");
b.Property<Guid?>("UpdatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("UpdatedOn")
.HasColumnType("TEXT");
b.Property<bool>("UseShellExecute")
.HasColumnType("INTEGER");
b.Property<string>("WorkingDirectory")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("CreatedById");
b.HasIndex("GameId");
b.HasIndex("UpdatedById");
b.ToTable("Servers");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.ServerConsole", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<Guid?>("CreatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedOn")
.HasColumnType("TEXT");
b.Property<string>("Host")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Password")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Path")
.IsRequired()
.HasColumnType("TEXT");
b.Property<int?>("Port")
.HasColumnType("INTEGER");
b.Property<Guid?>("ServerId")
.IsRequired()
.HasColumnType("TEXT");
b.Property<Guid?>("ServerId1")
.HasColumnType("TEXT");
b.Property<int>("Type")
.HasColumnType("INTEGER");
b.Property<Guid?>("UpdatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("UpdatedOn")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("CreatedById");
b.HasIndex("ServerId");
b.HasIndex("ServerId1");
b.HasIndex("UpdatedById");
b.ToTable("ServerConsoles");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.ServerHttpPath", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<Guid?>("CreatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedOn")
.HasColumnType("TEXT");
b.Property<string>("LocalPath")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Path")
.IsRequired()
.HasColumnType("TEXT");
b.Property<Guid>("ServerId")
.HasColumnType("TEXT");
b.Property<Guid?>("ServerId1")
.HasColumnType("TEXT");
b.Property<Guid?>("UpdatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("UpdatedOn")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("CreatedById");
b.HasIndex("ServerId");
b.HasIndex("ServerId1");
b.HasIndex("UpdatedById");
b.ToTable("ServerHttpPath");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.StorageLocation", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<Guid?>("CreatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedOn")
.HasColumnType("TEXT");
b.Property<bool>("Default")
.HasColumnType("INTEGER");
b.Property<string>("Path")
.IsRequired()
.HasColumnType("TEXT");
b.Property<int>("Type")
.HasColumnType("INTEGER");
b.Property<Guid?>("UpdatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("UpdatedOn")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("CreatedById");
b.HasIndex("UpdatedById");
b.ToTable("StorageLocations");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.Tag", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<Guid?>("CreatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedOn")
.HasColumnType("TEXT");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.Property<Guid?>("UpdatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("UpdatedOn")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("CreatedById");
b.HasIndex("UpdatedById");
b.ToTable("Tags");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.User", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<int>("AccessFailedCount")
.HasColumnType("INTEGER");
b.Property<string>("Alias")
.HasColumnType("TEXT");
b.Property<bool>("Approved")
.HasColumnType("INTEGER");
b.Property<DateTime?>("ApprovedOn")
.HasColumnType("TEXT");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("TEXT");
b.Property<Guid?>("CreatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedOn")
.HasColumnType("TEXT");
b.Property<string>("Email")
.HasMaxLength(256)
.HasColumnType("TEXT");
b.Property<bool>("EmailConfirmed")
.HasColumnType("INTEGER");
b.Property<bool>("LockoutEnabled")
.HasColumnType("INTEGER");
b.Property<DateTimeOffset?>("LockoutEnd")
.HasColumnType("TEXT");
b.Property<string>("NormalizedEmail")
.HasMaxLength(256)
.HasColumnType("TEXT");
b.Property<string>("NormalizedUserName")
.HasMaxLength(256)
.HasColumnType("TEXT");
b.Property<string>("PasswordHash")
.HasColumnType("TEXT");
b.Property<string>("PhoneNumber")
.HasColumnType("TEXT");
b.Property<bool>("PhoneNumberConfirmed")
.HasColumnType("INTEGER");
b.Property<string>("RefreshToken")
.HasColumnType("TEXT");
b.Property<DateTime>("RefreshTokenExpiration")
.HasColumnType("TEXT");
b.Property<string>("SecurityStamp")
.HasColumnType("TEXT");
b.Property<bool>("TwoFactorEnabled")
.HasColumnType("INTEGER");
b.Property<Guid?>("UpdatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("UpdatedOn")
.HasColumnType("TEXT");
b.Property<string>("UserName")
.HasMaxLength(256)
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("CreatedById");
b.HasIndex("NormalizedEmail")
.HasDatabaseName("EmailIndex");
b.HasIndex("NormalizedUserName")
.IsUnique()
.HasDatabaseName("UserNameIndex");
b.HasIndex("UpdatedById");
b.ToTable("Users", (string)null);
});
modelBuilder.Entity("LANCommander.Server.Data.Models.UserCustomField", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<Guid?>("CreatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedOn")
.HasColumnType("TEXT");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("TEXT");
b.Property<Guid?>("UpdatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("UpdatedOn")
.HasColumnType("TEXT");
b.Property<Guid?>("UserId")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Value")
.IsRequired()
.HasMaxLength(1024)
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("CreatedById");
b.HasIndex("UpdatedById");
b.HasIndex("UserId");
b.ToTable("UserCustomField");
});
modelBuilder.Entity("LibraryGame", b =>
{
b.Property<Guid>("GameId")
.HasColumnType("TEXT");
b.Property<Guid>("LibraryId")
.HasColumnType("TEXT");
b.HasKey("GameId", "LibraryId");
b.HasIndex("LibraryId");
b.ToTable("LibraryGame");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<System.Guid>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("ClaimType")
.HasColumnType("TEXT");
b.Property<string>("ClaimValue")
.HasColumnType("TEXT");
b.Property<Guid>("RoleId")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("RoleId");
b.ToTable("RoleClaims", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<System.Guid>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("ClaimType")
.HasColumnType("TEXT");
b.Property<string>("ClaimValue")
.HasColumnType("TEXT");
b.Property<Guid>("UserId")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("UserId");
b.ToTable("UserClaims", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<System.Guid>", b =>
{
b.Property<string>("LoginProvider")
.HasColumnType("TEXT");
b.Property<string>("ProviderKey")
.HasColumnType("TEXT");
b.Property<string>("ProviderDisplayName")
.HasColumnType("TEXT");
b.Property<Guid>("UserId")
.HasColumnType("TEXT");
b.HasKey("LoginProvider", "ProviderKey");
b.HasIndex("UserId");
b.ToTable("UserLogins", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<System.Guid>", b =>
{
b.Property<Guid>("UserId")
.HasColumnType("TEXT");
b.Property<Guid>("RoleId")
.HasColumnType("TEXT");
b.HasKey("UserId", "RoleId");
b.HasIndex("RoleId");
b.ToTable("UserRoles", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<System.Guid>", b =>
{
b.Property<Guid>("UserId")
.HasColumnType("TEXT");
b.Property<string>("LoginProvider")
.HasColumnType("TEXT");
b.Property<string>("Name")
.HasColumnType("TEXT");
b.Property<string>("Value")
.HasColumnType("TEXT");
b.HasKey("UserId", "LoginProvider", "Name");
b.ToTable("UserTokens", (string)null);
});
modelBuilder.Entity("PageGame", b =>
{
b.Property<Guid>("GameId")
.HasColumnType("TEXT");
b.Property<Guid>("PageId")
.HasColumnType("TEXT");
b.HasKey("GameId", "PageId");
b.HasIndex("PageId");
b.ToTable("PageGame");
});
modelBuilder.Entity("PageRedistributable", b =>
{
b.Property<Guid>("PageId")
.HasColumnType("TEXT");
b.Property<Guid>("RedistributableId")
.HasColumnType("TEXT");
b.HasKey("PageId", "RedistributableId");
b.HasIndex("RedistributableId");
b.ToTable("PageRedistributable");
});
modelBuilder.Entity("PageServer", b =>
{
b.Property<Guid>("PageId")
.HasColumnType("TEXT");
b.Property<Guid>("ServerId")
.HasColumnType("TEXT");
b.HasKey("PageId", "ServerId");
b.HasIndex("ServerId");
b.ToTable("PageServer");
});
modelBuilder.Entity("RoleCollection", b =>
{
b.Property<Guid>("CollectionId")
.HasColumnType("TEXT");
b.Property<Guid>("RoleId")
.HasColumnType("TEXT");
b.HasKey("CollectionId", "RoleId");
b.HasIndex("RoleId");
b.ToTable("RoleCollection");
});
modelBuilder.Entity("CategoryGame", b =>
{
b.HasOne("LANCommander.Server.Data.Models.Category", null)
.WithMany()
.HasForeignKey("CategoriesId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("LANCommander.Server.Data.Models.Game", null)
.WithMany()
.HasForeignKey("GamesId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("CollectionGame", b =>
{
b.HasOne("LANCommander.Server.Data.Models.Collection", null)
.WithMany()
.HasForeignKey("CollectionId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("LANCommander.Server.Data.Models.Game", null)
.WithMany()
.HasForeignKey("GameId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("GameDeveloper", b =>
{
b.HasOne("LANCommander.Server.Data.Models.Company", null)
.WithMany()
.HasForeignKey("DeveloperId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("LANCommander.Server.Data.Models.Game", null)
.WithMany()
.HasForeignKey("GameId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("GameGenre", b =>
{
b.HasOne("LANCommander.Server.Data.Models.Game", null)
.WithMany()
.HasForeignKey("GamesId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("LANCommander.Server.Data.Models.Genre", null)
.WithMany()
.HasForeignKey("GenresId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("GamePlatform", b =>
{
b.HasOne("LANCommander.Server.Data.Models.Game", null)
.WithMany()
.HasForeignKey("GamesId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("LANCommander.Server.Data.Models.Platform", null)
.WithMany()
.HasForeignKey("PlatformsId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("GamePublisher", b =>
{
b.HasOne("LANCommander.Server.Data.Models.Game", null)
.WithMany()
.HasForeignKey("GameId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("LANCommander.Server.Data.Models.Company", null)
.WithMany()
.HasForeignKey("PublisherId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("GameRedistributable", b =>
{
b.HasOne("LANCommander.Server.Data.Models.Game", null)
.WithMany()
.HasForeignKey("GameId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("LANCommander.Server.Data.Models.Redistributable", null)
.WithMany()
.HasForeignKey("RedistributableId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("GameTag", b =>
{
b.HasOne("LANCommander.Server.Data.Models.Game", null)
.WithMany()
.HasForeignKey("GamesId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("LANCommander.Server.Data.Models.Tag", null)
.WithMany()
.HasForeignKey("TagsId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("LANCommander.Server.Data.Models.Action", b =>
{
b.HasOne("LANCommander.Server.Data.Models.User", "CreatedBy")
.WithMany()
.HasForeignKey("CreatedById")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("LANCommander.Server.Data.Models.Game", "Game")
.WithMany("Actions")
.HasForeignKey("GameId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("LANCommander.Server.Data.Models.Server", "Server")
.WithMany("Actions")
.HasForeignKey("ServerId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("LANCommander.Server.Data.Models.User", "UpdatedBy")
.WithMany()
.HasForeignKey("UpdatedById")
.OnDelete(DeleteBehavior.SetNull);
b.Navigation("CreatedBy");
b.Navigation("Game");
b.Navigation("Server");
b.Navigation("UpdatedBy");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.Archive", b =>
{
b.HasOne("LANCommander.Server.Data.Models.User", "CreatedBy")
.WithMany()
.HasForeignKey("CreatedById")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("LANCommander.Server.Data.Models.Game", "Game")
.WithMany("Archives")
.HasForeignKey("GameId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("LANCommander.Server.Data.Models.Archive", "LastVersion")
.WithMany()
.HasForeignKey("LastVersionId");
b.HasOne("LANCommander.Server.Data.Models.Redistributable", "Redistributable")
.WithMany("Archives")
.HasForeignKey("RedistributableId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("LANCommander.Server.Data.Models.StorageLocation", "StorageLocation")
.WithMany("Archives")
.HasForeignKey("StorageLocationId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("LANCommander.Server.Data.Models.User", "UpdatedBy")
.WithMany()
.HasForeignKey("UpdatedById")
.OnDelete(DeleteBehavior.SetNull);
b.Navigation("CreatedBy");
b.Navigation("Game");
b.Navigation("LastVersion");
b.Navigation("Redistributable");
b.Navigation("StorageLocation");
b.Navigation("UpdatedBy");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.Category", b =>
{
b.HasOne("LANCommander.Server.Data.Models.User", "CreatedBy")
.WithMany()
.HasForeignKey("CreatedById")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("LANCommander.Server.Data.Models.Category", "Parent")
.WithMany("Children")
.HasForeignKey("ParentId");
b.HasOne("LANCommander.Server.Data.Models.User", "UpdatedBy")
.WithMany()
.HasForeignKey("UpdatedById")
.OnDelete(DeleteBehavior.SetNull);
b.Navigation("CreatedBy");
b.Navigation("Parent");
b.Navigation("UpdatedBy");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.Collection", b =>
{
b.HasOne("LANCommander.Server.Data.Models.User", "CreatedBy")
.WithMany()
.HasForeignKey("CreatedById")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("LANCommander.Server.Data.Models.User", "UpdatedBy")
.WithMany()
.HasForeignKey("UpdatedById")
.OnDelete(DeleteBehavior.SetNull);
b.Navigation("CreatedBy");
b.Navigation("UpdatedBy");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.Company", b =>
{
b.HasOne("LANCommander.Server.Data.Models.User", "CreatedBy")
.WithMany()
.HasForeignKey("CreatedById")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("LANCommander.Server.Data.Models.User", "UpdatedBy")
.WithMany()
.HasForeignKey("UpdatedById")
.OnDelete(DeleteBehavior.SetNull);
b.Navigation("CreatedBy");
b.Navigation("UpdatedBy");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.Engine", b =>
{
b.HasOne("LANCommander.Server.Data.Models.User", "CreatedBy")
.WithMany()
.HasForeignKey("CreatedById");
b.HasOne("LANCommander.Server.Data.Models.User", "UpdatedBy")
.WithMany()
.HasForeignKey("UpdatedById");
b.Navigation("CreatedBy");
b.Navigation("UpdatedBy");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.Game", b =>
{
b.HasOne("LANCommander.Server.Data.Models.Game", "BaseGame")
.WithMany("DependentGames")
.HasForeignKey("BaseGameId")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("LANCommander.Server.Data.Models.User", "CreatedBy")
.WithMany()
.HasForeignKey("CreatedById")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("LANCommander.Server.Data.Models.Engine", "Engine")
.WithMany("Games")
.HasForeignKey("EngineId")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("LANCommander.Server.Data.Models.User", "UpdatedBy")
.WithMany()
.HasForeignKey("UpdatedById")
.OnDelete(DeleteBehavior.SetNull);
b.Navigation("BaseGame");
b.Navigation("CreatedBy");
b.Navigation("Engine");
b.Navigation("UpdatedBy");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.GameCustomField", b =>
{
b.HasOne("LANCommander.Server.Data.Models.User", "CreatedBy")
.WithMany()
.HasForeignKey("CreatedById");
b.HasOne("LANCommander.Server.Data.Models.Game", "Game")
.WithMany("CustomFields")
.HasForeignKey("GameId");
b.HasOne("LANCommander.Server.Data.Models.User", "UpdatedBy")
.WithMany()
.HasForeignKey("UpdatedById");
b.Navigation("CreatedBy");
b.Navigation("Game");
b.Navigation("UpdatedBy");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.GameSave", b =>
{
b.HasOne("LANCommander.Server.Data.Models.User", "CreatedBy")
.WithMany()
.HasForeignKey("CreatedById")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("LANCommander.Server.Data.Models.Game", "Game")
.WithMany("GameSaves")
.HasForeignKey("GameId")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("LANCommander.Server.Data.Models.StorageLocation", "StorageLocation")
.WithMany("GameSaves")
.HasForeignKey("StorageLocationId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("LANCommander.Server.Data.Models.User", "UpdatedBy")
.WithMany()
.HasForeignKey("UpdatedById")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("LANCommander.Server.Data.Models.User", "User")
.WithMany("GameSaves")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CreatedBy");
b.Navigation("Game");
b.Navigation("StorageLocation");
b.Navigation("UpdatedBy");
b.Navigation("User");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.Genre", b =>
{
b.HasOne("LANCommander.Server.Data.Models.User", "CreatedBy")
.WithMany()
.HasForeignKey("CreatedById")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("LANCommander.Server.Data.Models.User", "UpdatedBy")
.WithMany()
.HasForeignKey("UpdatedById")
.OnDelete(DeleteBehavior.SetNull);
b.Navigation("CreatedBy");
b.Navigation("UpdatedBy");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.Issue", b =>
{
b.HasOne("LANCommander.Server.Data.Models.User", "CreatedBy")
.WithMany()
.HasForeignKey("CreatedById")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("LANCommander.Server.Data.Models.Game", "Game")
.WithMany("Issues")
.HasForeignKey("GameId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("LANCommander.Server.Data.Models.User", "ResolvedBy")
.WithMany()
.HasForeignKey("ResolvedById");
b.HasOne("LANCommander.Server.Data.Models.User", "UpdatedBy")
.WithMany()
.HasForeignKey("UpdatedById")
.OnDelete(DeleteBehavior.SetNull);
b.Navigation("CreatedBy");
b.Navigation("Game");
b.Navigation("ResolvedBy");
b.Navigation("UpdatedBy");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.Key", b =>
{
b.HasOne("LANCommander.Server.Data.Models.User", "ClaimedByUser")
.WithMany()
.HasForeignKey("ClaimedByUserId");
b.HasOne("LANCommander.Server.Data.Models.User", "CreatedBy")
.WithMany()
.HasForeignKey("CreatedById")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("LANCommander.Server.Data.Models.Game", "Game")
.WithMany("Keys")
.HasForeignKey("GameId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("LANCommander.Server.Data.Models.User", "UpdatedBy")
.WithMany()
.HasForeignKey("UpdatedById")
.OnDelete(DeleteBehavior.SetNull);
b.Navigation("ClaimedByUser");
b.Navigation("CreatedBy");
b.Navigation("Game");
b.Navigation("UpdatedBy");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.Library", b =>
{
b.HasOne("LANCommander.Server.Data.Models.User", "CreatedBy")
.WithMany()
.HasForeignKey("CreatedById")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("LANCommander.Server.Data.Models.User", "UpdatedBy")
.WithMany()
.HasForeignKey("UpdatedById")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("LANCommander.Server.Data.Models.User", "User")
.WithOne("Library")
.HasForeignKey("LANCommander.Server.Data.Models.Library", "UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CreatedBy");
b.Navigation("UpdatedBy");
b.Navigation("User");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.Media", b =>
{
b.HasOne("LANCommander.Server.Data.Models.User", "CreatedBy")
.WithMany()
.HasForeignKey("CreatedById")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("LANCommander.Server.Data.Models.Game", "Game")
.WithMany("Media")
.HasForeignKey("GameId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("LANCommander.Server.Data.Models.StorageLocation", "StorageLocation")
.WithMany("Media")
.HasForeignKey("StorageLocationId")
.OnDelete(DeleteBehavior.SetNull)
.IsRequired();
b.HasOne("LANCommander.Server.Data.Models.Media", "Thumbnail")
.WithOne("Parent")
.HasForeignKey("LANCommander.Server.Data.Models.Media", "ThumbnailId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("LANCommander.Server.Data.Models.User", "UpdatedBy")
.WithMany()
.HasForeignKey("UpdatedById")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("LANCommander.Server.Data.Models.User", "User")
.WithMany("Media")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade);
b.Navigation("CreatedBy");
b.Navigation("Game");
b.Navigation("StorageLocation");
b.Navigation("Thumbnail");
b.Navigation("UpdatedBy");
b.Navigation("User");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.MultiplayerMode", b =>
{
b.HasOne("LANCommander.Server.Data.Models.User", "CreatedBy")
.WithMany()
.HasForeignKey("CreatedById")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("LANCommander.Server.Data.Models.Game", "Game")
.WithMany("MultiplayerModes")
.HasForeignKey("GameId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("LANCommander.Server.Data.Models.User", "UpdatedBy")
.WithMany()
.HasForeignKey("UpdatedById")
.OnDelete(DeleteBehavior.SetNull);
b.Navigation("CreatedBy");
b.Navigation("Game");
b.Navigation("UpdatedBy");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.Page", b =>
{
b.HasOne("LANCommander.Server.Data.Models.User", "CreatedBy")
.WithMany()
.HasForeignKey("CreatedById")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("LANCommander.Server.Data.Models.Page", "Parent")
.WithMany("Children")
.HasForeignKey("ParentId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("LANCommander.Server.Data.Models.User", "UpdatedBy")
.WithMany()
.HasForeignKey("UpdatedById")
.OnDelete(DeleteBehavior.SetNull);
b.Navigation("CreatedBy");
b.Navigation("Parent");
b.Navigation("UpdatedBy");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.Platform", b =>
{
b.HasOne("LANCommander.Server.Data.Models.User", "CreatedBy")
.WithMany()
.HasForeignKey("CreatedById")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("LANCommander.Server.Data.Models.User", "UpdatedBy")
.WithMany()
.HasForeignKey("UpdatedById")
.OnDelete(DeleteBehavior.SetNull);
b.Navigation("CreatedBy");
b.Navigation("UpdatedBy");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.PlaySession", b =>
{
b.HasOne("LANCommander.Server.Data.Models.User", "CreatedBy")
.WithMany()
.HasForeignKey("CreatedById")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("LANCommander.Server.Data.Models.Game", "Game")
.WithMany("PlaySessions")
.HasForeignKey("GameId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("LANCommander.Server.Data.Models.User", "UpdatedBy")
.WithMany()
.HasForeignKey("UpdatedById")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("LANCommander.Server.Data.Models.User", "User")
.WithMany("PlaySessions")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CreatedBy");
b.Navigation("Game");
b.Navigation("UpdatedBy");
b.Navigation("User");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.Redistributable", b =>
{
b.HasOne("LANCommander.Server.Data.Models.User", "CreatedBy")
.WithMany()
.HasForeignKey("CreatedById")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("LANCommander.Server.Data.Models.User", "UpdatedBy")
.WithMany()
.HasForeignKey("UpdatedById")
.OnDelete(DeleteBehavior.SetNull);
b.Navigation("CreatedBy");
b.Navigation("UpdatedBy");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.Role", b =>
{
b.HasOne("LANCommander.Server.Data.Models.User", "CreatedBy")
.WithMany()
.HasForeignKey("CreatedById")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("LANCommander.Server.Data.Models.User", "UpdatedBy")
.WithMany()
.HasForeignKey("UpdatedById")
.OnDelete(DeleteBehavior.SetNull);
b.Navigation("CreatedBy");
b.Navigation("UpdatedBy");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.SavePath", b =>
{
b.HasOne("LANCommander.Server.Data.Models.User", "CreatedBy")
.WithMany()
.HasForeignKey("CreatedById")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("LANCommander.Server.Data.Models.Game", "Game")
.WithMany("SavePaths")
.HasForeignKey("GameId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("LANCommander.Server.Data.Models.User", "UpdatedBy")
.WithMany()
.HasForeignKey("UpdatedById")
.OnDelete(DeleteBehavior.SetNull);
b.Navigation("CreatedBy");
b.Navigation("Game");
b.Navigation("UpdatedBy");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.Script", b =>
{
b.HasOne("LANCommander.Server.Data.Models.User", "CreatedBy")
.WithMany()
.HasForeignKey("CreatedById")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("LANCommander.Server.Data.Models.Game", "Game")
.WithMany("Scripts")
.HasForeignKey("GameId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("LANCommander.Server.Data.Models.Redistributable", "Redistributable")
.WithMany("Scripts")
.HasForeignKey("RedistributableId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("LANCommander.Server.Data.Models.Server", "Server")
.WithMany("Scripts")
.HasForeignKey("ServerId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("LANCommander.Server.Data.Models.User", "UpdatedBy")
.WithMany()
.HasForeignKey("UpdatedById")
.OnDelete(DeleteBehavior.SetNull);
b.Navigation("CreatedBy");
b.Navigation("Game");
b.Navigation("Redistributable");
b.Navigation("Server");
b.Navigation("UpdatedBy");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.Server", b =>
{
b.HasOne("LANCommander.Server.Data.Models.User", "CreatedBy")
.WithMany()
.HasForeignKey("CreatedById")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("LANCommander.Server.Data.Models.Game", "Game")
.WithMany("Servers")
.HasForeignKey("GameId")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("LANCommander.Server.Data.Models.User", "UpdatedBy")
.WithMany()
.HasForeignKey("UpdatedById")
.OnDelete(DeleteBehavior.SetNull);
b.Navigation("CreatedBy");
b.Navigation("Game");
b.Navigation("UpdatedBy");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.ServerConsole", b =>
{
b.HasOne("LANCommander.Server.Data.Models.User", "CreatedBy")
.WithMany()
.HasForeignKey("CreatedById")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("LANCommander.Server.Data.Models.Server", "Server")
.WithMany()
.HasForeignKey("ServerId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("LANCommander.Server.Data.Models.Server", null)
.WithMany("ServerConsoles")
.HasForeignKey("ServerId1");
b.HasOne("LANCommander.Server.Data.Models.User", "UpdatedBy")
.WithMany()
.HasForeignKey("UpdatedById")
.OnDelete(DeleteBehavior.SetNull);
b.Navigation("CreatedBy");
b.Navigation("Server");
b.Navigation("UpdatedBy");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.ServerHttpPath", b =>
{
b.HasOne("LANCommander.Server.Data.Models.User", "CreatedBy")
.WithMany()
.HasForeignKey("CreatedById")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("LANCommander.Server.Data.Models.Server", "Server")
.WithMany()
.HasForeignKey("ServerId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("LANCommander.Server.Data.Models.Server", null)
.WithMany("HttpPaths")
.HasForeignKey("ServerId1");
b.HasOne("LANCommander.Server.Data.Models.User", "UpdatedBy")
.WithMany()
.HasForeignKey("UpdatedById")
.OnDelete(DeleteBehavior.SetNull);
b.Navigation("CreatedBy");
b.Navigation("Server");
b.Navigation("UpdatedBy");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.StorageLocation", b =>
{
b.HasOne("LANCommander.Server.Data.Models.User", "CreatedBy")
.WithMany()
.HasForeignKey("CreatedById");
b.HasOne("LANCommander.Server.Data.Models.User", "UpdatedBy")
.WithMany()
.HasForeignKey("UpdatedById");
b.Navigation("CreatedBy");
b.Navigation("UpdatedBy");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.Tag", b =>
{
b.HasOne("LANCommander.Server.Data.Models.User", "CreatedBy")
.WithMany()
.HasForeignKey("CreatedById")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("LANCommander.Server.Data.Models.User", "UpdatedBy")
.WithMany()
.HasForeignKey("UpdatedById")
.OnDelete(DeleteBehavior.SetNull);
b.Navigation("CreatedBy");
b.Navigation("UpdatedBy");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.User", b =>
{
b.HasOne("LANCommander.Server.Data.Models.User", "CreatedBy")
.WithMany()
.HasForeignKey("CreatedById")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("LANCommander.Server.Data.Models.User", "UpdatedBy")
.WithMany()
.HasForeignKey("UpdatedById")
.OnDelete(DeleteBehavior.SetNull);
b.Navigation("CreatedBy");
b.Navigation("UpdatedBy");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.UserCustomField", b =>
{
b.HasOne("LANCommander.Server.Data.Models.User", "CreatedBy")
.WithMany()
.HasForeignKey("CreatedById")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("LANCommander.Server.Data.Models.User", "UpdatedBy")
.WithMany()
.HasForeignKey("UpdatedById")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("LANCommander.Server.Data.Models.User", "User")
.WithMany("CustomFields")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CreatedBy");
b.Navigation("UpdatedBy");
b.Navigation("User");
});
modelBuilder.Entity("LibraryGame", b =>
{
b.HasOne("LANCommander.Server.Data.Models.Game", null)
.WithMany()
.HasForeignKey("GameId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("LANCommander.Server.Data.Models.Library", null)
.WithMany()
.HasForeignKey("LibraryId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<System.Guid>", b =>
{
b.HasOne("LANCommander.Server.Data.Models.Role", null)
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<System.Guid>", b =>
{
b.HasOne("LANCommander.Server.Data.Models.User", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<System.Guid>", b =>
{
b.HasOne("LANCommander.Server.Data.Models.User", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<System.Guid>", b =>
{
b.HasOne("LANCommander.Server.Data.Models.Role", null)
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("LANCommander.Server.Data.Models.User", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<System.Guid>", b =>
{
b.HasOne("LANCommander.Server.Data.Models.User", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("PageGame", b =>
{
b.HasOne("LANCommander.Server.Data.Models.Game", null)
.WithMany()
.HasForeignKey("GameId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("LANCommander.Server.Data.Models.Page", null)
.WithMany()
.HasForeignKey("PageId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("PageRedistributable", b =>
{
b.HasOne("LANCommander.Server.Data.Models.Page", null)
.WithMany()
.HasForeignKey("PageId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("LANCommander.Server.Data.Models.Redistributable", null)
.WithMany()
.HasForeignKey("RedistributableId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("PageServer", b =>
{
b.HasOne("LANCommander.Server.Data.Models.Page", null)
.WithMany()
.HasForeignKey("PageId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("LANCommander.Server.Data.Models.Server", null)
.WithMany()
.HasForeignKey("ServerId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("RoleCollection", b =>
{
b.HasOne("LANCommander.Server.Data.Models.Collection", null)
.WithMany()
.HasForeignKey("CollectionId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("LANCommander.Server.Data.Models.Role", null)
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("LANCommander.Server.Data.Models.Category", b =>
{
b.Navigation("Children");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.Engine", b =>
{
b.Navigation("Games");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.Game", b =>
{
b.Navigation("Actions");
b.Navigation("Archives");
b.Navigation("CustomFields");
b.Navigation("DependentGames");
b.Navigation("GameSaves");
b.Navigation("Issues");
b.Navigation("Keys");
b.Navigation("Media");
b.Navigation("MultiplayerModes");
b.Navigation("PlaySessions");
b.Navigation("SavePaths");
b.Navigation("Scripts");
b.Navigation("Servers");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.Media", b =>
{
b.Navigation("Parent");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.Page", b =>
{
b.Navigation("Children");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.Redistributable", b =>
{
b.Navigation("Archives");
b.Navigation("Scripts");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.Server", b =>
{
b.Navigation("Actions");
b.Navigation("HttpPaths");
b.Navigation("Scripts");
b.Navigation("ServerConsoles");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.StorageLocation", b =>
{
b.Navigation("Archives");
b.Navigation("GameSaves");
b.Navigation("Media");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.User", b =>
{
b.Navigation("CustomFields");
b.Navigation("GameSaves");
b.Navigation("Library")
.IsRequired();
b.Navigation("Media");
b.Navigation("PlaySessions");
});
#pragma warning restore 612, 618
}
|
/// <inheritdoc />
|
https://github.com/LANCommander/LANCommander/blob/51bc43ac93e3008391a2c78f958cbfc1d108bd80/LANCommander.Server.Data.SQLite/Migrations/20250131011110_AddGameCustomFields.Designer.cs#L18-L2792
|
51bc43ac93e3008391a2c78f958cbfc1d108bd80
|
LANCommander
|
github_2023
|
LANCommander
|
csharp
|
AddRedistributables.Up
|
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<Guid>(
name: "GameId",
table: "Scripts",
type: "TEXT",
nullable: true,
oldClrType: typeof(Guid),
oldType: "TEXT");
migrationBuilder.AddColumn<Guid>(
name: "RedistributableId",
table: "Scripts",
type: "TEXT",
nullable: true);
migrationBuilder.AlterColumn<Guid>(
name: "GameId",
table: "Archive",
type: "TEXT",
nullable: true,
oldClrType: typeof(Guid),
oldType: "TEXT");
migrationBuilder.AddColumn<Guid>(
name: "RedistributableId",
table: "Archive",
type: "TEXT",
nullable: true);
migrationBuilder.CreateTable(
name: "Redistributables",
columns: table => new
{
Id = table.Column<Guid>(type: "TEXT", nullable: false),
Name = table.Column<string>(type: "TEXT", nullable: false),
Description = table.Column<string>(type: "TEXT", nullable: true),
Notes = table.Column<string>(type: "TEXT", nullable: true),
CreatedOn = table.Column<DateTime>(type: "TEXT", nullable: false),
CreatedById = table.Column<Guid>(type: "TEXT", nullable: true),
UpdatedOn = table.Column<DateTime>(type: "TEXT", nullable: false),
UpdatedById = table.Column<Guid>(type: "TEXT", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Redistributables", x => x.Id);
table.ForeignKey(
name: "FK_Redistributables_AspNetUsers_CreatedById",
column: x => x.CreatedById,
principalTable: "AspNetUsers",
principalColumn: "Id");
table.ForeignKey(
name: "FK_Redistributables_AspNetUsers_UpdatedById",
column: x => x.UpdatedById,
principalTable: "AspNetUsers",
principalColumn: "Id");
});
migrationBuilder.CreateIndex(
name: "IX_Scripts_RedistributableId",
table: "Scripts",
column: "RedistributableId");
migrationBuilder.CreateIndex(
name: "IX_Archive_RedistributableId",
table: "Archive",
column: "RedistributableId");
migrationBuilder.CreateIndex(
name: "IX_Redistributables_CreatedById",
table: "Redistributables",
column: "CreatedById");
migrationBuilder.CreateIndex(
name: "IX_Redistributables_UpdatedById",
table: "Redistributables",
column: "UpdatedById");
migrationBuilder.AddForeignKey(
name: "FK_Archive_Redistributables_RedistributableId",
table: "Archive",
column: "RedistributableId",
principalTable: "Redistributables",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_Scripts_Redistributables_RedistributableId",
table: "Scripts",
column: "RedistributableId",
principalTable: "Redistributables",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
|
/// <inheritdoc />
|
https://github.com/LANCommander/LANCommander/blob/51bc43ac93e3008391a2c78f958cbfc1d108bd80/LANCommander.Server.Data.SQLite/Migrations/20231018060152_AddRedistributables.cs#L12-L105
|
51bc43ac93e3008391a2c78f958cbfc1d108bd80
|
LANCommander
|
github_2023
|
LANCommander
|
csharp
|
AddStorageLocations.BuildTargetModel
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "8.0.8")
.HasAnnotation("Proxies:ChangeTracking", false)
.HasAnnotation("Proxies:CheckEquality", false)
.HasAnnotation("Proxies:LazyLoading", true);
modelBuilder.Entity("CategoryGame", b =>
{
b.Property<Guid>("CategoriesId")
.HasColumnType("TEXT");
b.Property<Guid>("GamesId")
.HasColumnType("TEXT");
b.HasKey("CategoriesId", "GamesId");
b.HasIndex("GamesId");
b.ToTable("CategoryGame");
});
modelBuilder.Entity("CollectionGame", b =>
{
b.Property<Guid>("CollectionId")
.HasColumnType("TEXT");
b.Property<Guid>("GameId")
.HasColumnType("TEXT");
b.HasKey("CollectionId", "GameId");
b.HasIndex("GameId");
b.ToTable("CollectionGame");
});
modelBuilder.Entity("GameDeveloper", b =>
{
b.Property<Guid>("DeveloperId")
.HasColumnType("TEXT");
b.Property<Guid>("GameId")
.HasColumnType("TEXT");
b.HasKey("DeveloperId", "GameId");
b.HasIndex("GameId");
b.ToTable("GameDeveloper");
});
modelBuilder.Entity("GameGenre", b =>
{
b.Property<Guid>("GamesId")
.HasColumnType("TEXT");
b.Property<Guid>("GenresId")
.HasColumnType("TEXT");
b.HasKey("GamesId", "GenresId");
b.HasIndex("GenresId");
b.ToTable("GameGenre");
});
modelBuilder.Entity("GamePlatform", b =>
{
b.Property<Guid>("GamesId")
.HasColumnType("TEXT");
b.Property<Guid>("PlatformsId")
.HasColumnType("TEXT");
b.HasKey("GamesId", "PlatformsId");
b.HasIndex("PlatformsId");
b.ToTable("GamePlatform");
});
modelBuilder.Entity("GamePublisher", b =>
{
b.Property<Guid>("GameId")
.HasColumnType("TEXT");
b.Property<Guid>("PublisherId")
.HasColumnType("TEXT");
b.HasKey("GameId", "PublisherId");
b.HasIndex("PublisherId");
b.ToTable("GamePublisher");
});
modelBuilder.Entity("GameRedistributable", b =>
{
b.Property<Guid>("GameId")
.HasColumnType("TEXT");
b.Property<Guid>("RedistributableId")
.HasColumnType("TEXT");
b.HasKey("GameId", "RedistributableId");
b.HasIndex("RedistributableId");
b.ToTable("GameRedistributable");
});
modelBuilder.Entity("GameTag", b =>
{
b.Property<Guid>("GamesId")
.HasColumnType("TEXT");
b.Property<Guid>("TagsId")
.HasColumnType("TEXT");
b.HasKey("GamesId", "TagsId");
b.HasIndex("TagsId");
b.ToTable("GameTag");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.Action", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("Arguments")
.HasColumnType("TEXT");
b.Property<Guid?>("CreatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedOn")
.HasColumnType("TEXT");
b.Property<Guid?>("GameId")
.HasColumnType("TEXT");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Path")
.HasColumnType("TEXT");
b.Property<bool>("PrimaryAction")
.HasColumnType("INTEGER");
b.Property<Guid?>("ServerId")
.HasColumnType("TEXT");
b.Property<int>("SortOrder")
.HasColumnType("INTEGER");
b.Property<Guid?>("UpdatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("UpdatedOn")
.HasColumnType("TEXT");
b.Property<string>("WorkingDirectory")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("CreatedById");
b.HasIndex("GameId");
b.HasIndex("ServerId");
b.HasIndex("UpdatedById");
b.ToTable("Actions");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.Archive", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("Changelog")
.HasColumnType("TEXT");
b.Property<long>("CompressedSize")
.HasColumnType("INTEGER");
b.Property<Guid?>("CreatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedOn")
.HasColumnType("TEXT");
b.Property<Guid?>("GameId")
.HasColumnType("TEXT");
b.Property<Guid?>("LastVersionId")
.HasColumnType("TEXT");
b.Property<string>("ObjectKey")
.IsRequired()
.HasColumnType("TEXT");
b.Property<Guid?>("RedistributableId")
.HasColumnType("TEXT");
b.Property<Guid>("StorageLocationId")
.HasColumnType("TEXT");
b.Property<long>("UncompressedSize")
.HasColumnType("INTEGER");
b.Property<Guid?>("UpdatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("UpdatedOn")
.HasColumnType("TEXT");
b.Property<string>("Version")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("CreatedById");
b.HasIndex("GameId");
b.HasIndex("LastVersionId");
b.HasIndex("RedistributableId");
b.HasIndex("StorageLocationId");
b.HasIndex("UpdatedById");
b.ToTable("Archive");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.Category", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<Guid?>("CreatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedOn")
.HasColumnType("TEXT");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.Property<Guid>("ParentId")
.HasColumnType("TEXT");
b.Property<Guid?>("UpdatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("UpdatedOn")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("CreatedById");
b.HasIndex("ParentId");
b.HasIndex("UpdatedById");
b.ToTable("Categories");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.Collection", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<Guid?>("CreatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedOn")
.HasColumnType("TEXT");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.Property<Guid?>("UpdatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("UpdatedOn")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("CreatedById");
b.HasIndex("UpdatedById");
b.ToTable("Collections");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.Company", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<Guid?>("CreatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedOn")
.HasColumnType("TEXT");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.Property<Guid?>("UpdatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("UpdatedOn")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("CreatedById");
b.HasIndex("UpdatedById");
b.ToTable("Companies");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.Engine", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<Guid?>("CreatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedOn")
.HasColumnType("TEXT");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.Property<Guid?>("UpdatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("UpdatedOn")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("CreatedById");
b.HasIndex("UpdatedById");
b.ToTable("Engines");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.Game", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<Guid?>("BaseGameId")
.HasColumnType("TEXT");
b.Property<Guid?>("CreatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedOn")
.HasColumnType("TEXT");
b.Property<string>("Description")
.HasColumnType("TEXT");
b.Property<string>("DirectoryName")
.HasColumnType("TEXT");
b.Property<Guid?>("EngineId")
.HasColumnType("TEXT");
b.Property<long?>("IGDBId")
.HasColumnType("INTEGER");
b.Property<int>("KeyAllocationMethod")
.HasColumnType("INTEGER");
b.Property<string>("Notes")
.HasColumnType("TEXT");
b.Property<DateTime?>("ReleasedOn")
.HasColumnType("TEXT");
b.Property<bool>("Singleplayer")
.HasColumnType("INTEGER");
b.Property<string>("SortTitle")
.HasColumnType("TEXT");
b.Property<string>("Title")
.IsRequired()
.HasColumnType("TEXT");
b.Property<int>("Type")
.HasColumnType("INTEGER");
b.Property<Guid?>("UpdatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("UpdatedOn")
.HasColumnType("TEXT");
b.Property<string>("ValidKeyRegex")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("BaseGameId");
b.HasIndex("CreatedById");
b.HasIndex("EngineId");
b.HasIndex("UpdatedById");
b.ToTable("Games");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.GameSave", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<Guid?>("CreatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedOn")
.HasColumnType("TEXT");
b.Property<Guid?>("GameId")
.HasColumnType("TEXT");
b.Property<Guid>("StorageLocationId")
.HasColumnType("TEXT");
b.Property<Guid?>("UpdatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("UpdatedOn")
.HasColumnType("TEXT");
b.Property<Guid>("UserId")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("CreatedById");
b.HasIndex("GameId");
b.HasIndex("StorageLocationId");
b.HasIndex("UpdatedById");
b.HasIndex("UserId");
b.ToTable("GameSaves");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.Genre", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<Guid?>("CreatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedOn")
.HasColumnType("TEXT");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.Property<Guid?>("UpdatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("UpdatedOn")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("CreatedById");
b.HasIndex("UpdatedById");
b.ToTable("Genres");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.Issue", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<Guid?>("CreatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedOn")
.HasColumnType("TEXT");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("TEXT");
b.Property<Guid>("GameId")
.HasColumnType("TEXT");
b.Property<Guid?>("ResolvedById")
.HasColumnType("TEXT");
b.Property<DateTime?>("ResolvedOn")
.HasColumnType("TEXT");
b.Property<Guid?>("UpdatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("UpdatedOn")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("CreatedById");
b.HasIndex("GameId");
b.HasIndex("ResolvedById");
b.HasIndex("UpdatedById");
b.ToTable("Issues");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.Key", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<int>("AllocationMethod")
.HasColumnType("INTEGER");
b.Property<string>("ClaimedByComputerName")
.HasMaxLength(255)
.HasColumnType("TEXT");
b.Property<string>("ClaimedByIpv4Address")
.HasMaxLength(15)
.HasColumnType("TEXT");
b.Property<string>("ClaimedByMacAddress")
.HasMaxLength(17)
.HasColumnType("TEXT");
b.Property<Guid?>("ClaimedByUserId")
.HasColumnType("TEXT");
b.Property<DateTime?>("ClaimedOn")
.HasColumnType("TEXT");
b.Property<Guid?>("CreatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedOn")
.HasColumnType("TEXT");
b.Property<Guid>("GameId")
.HasColumnType("TEXT");
b.Property<Guid?>("UpdatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("UpdatedOn")
.HasColumnType("TEXT");
b.Property<string>("Value")
.IsRequired()
.HasMaxLength(255)
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("ClaimedByUserId");
b.HasIndex("CreatedById");
b.HasIndex("GameId");
b.HasIndex("UpdatedById");
b.ToTable("Keys");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.Media", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("Crc32")
.IsRequired()
.HasMaxLength(8)
.HasColumnType("TEXT");
b.Property<Guid?>("CreatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedOn")
.HasColumnType("TEXT");
b.Property<Guid>("FileId")
.HasColumnType("TEXT");
b.Property<Guid?>("GameId")
.HasColumnType("TEXT");
b.Property<string>("MimeType")
.HasMaxLength(255)
.HasColumnType("TEXT");
b.Property<string>("Name")
.HasMaxLength(64)
.HasColumnType("TEXT");
b.Property<string>("SourceUrl")
.HasMaxLength(2048)
.HasColumnType("TEXT");
b.Property<Guid>("StorageLocationId")
.HasColumnType("TEXT");
b.Property<Guid?>("ThumbnailId")
.HasColumnType("TEXT");
b.Property<int>("Type")
.HasColumnType("INTEGER");
b.Property<Guid?>("UpdatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("UpdatedOn")
.HasColumnType("TEXT");
b.Property<Guid?>("UserId")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("CreatedById");
b.HasIndex("GameId");
b.HasIndex("StorageLocationId");
b.HasIndex("ThumbnailId")
.IsUnique();
b.HasIndex("UpdatedById");
b.HasIndex("UserId");
b.ToTable("Media");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.MultiplayerMode", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<Guid?>("CreatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedOn")
.HasColumnType("TEXT");
b.Property<string>("Description")
.HasColumnType("TEXT");
b.Property<Guid?>("GameId")
.IsRequired()
.HasColumnType("TEXT");
b.Property<int>("MaxPlayers")
.HasColumnType("INTEGER");
b.Property<int>("MinPlayers")
.HasColumnType("INTEGER");
b.Property<int>("NetworkProtocol")
.HasColumnType("INTEGER");
b.Property<int>("Spectators")
.HasColumnType("INTEGER");
b.Property<int>("Type")
.HasColumnType("INTEGER");
b.Property<Guid?>("UpdatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("UpdatedOn")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("CreatedById");
b.HasIndex("GameId");
b.HasIndex("UpdatedById");
b.ToTable("MultiplayerModes");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.Page", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("Contents")
.IsRequired()
.HasColumnType("TEXT");
b.Property<Guid?>("CreatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedOn")
.HasColumnType("TEXT");
b.Property<Guid?>("ParentId")
.HasColumnType("TEXT");
b.Property<string>("Route")
.IsRequired()
.HasMaxLength(2048)
.HasColumnType("TEXT");
b.Property<string>("Slug")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("TEXT");
b.Property<int>("SortOrder")
.HasColumnType("INTEGER");
b.Property<string>("Title")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("TEXT");
b.Property<Guid?>("UpdatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("UpdatedOn")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("CreatedById");
b.HasIndex("ParentId");
b.HasIndex("UpdatedById");
b.ToTable("Pages");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.Platform", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<Guid?>("CreatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedOn")
.HasColumnType("TEXT");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.Property<Guid?>("UpdatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("UpdatedOn")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("CreatedById");
b.HasIndex("UpdatedById");
b.ToTable("Platforms");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.PlaySession", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<Guid?>("CreatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedOn")
.HasColumnType("TEXT");
b.Property<DateTime?>("End")
.HasColumnType("TEXT");
b.Property<Guid?>("GameId")
.HasColumnType("TEXT");
b.Property<DateTime?>("Start")
.HasColumnType("TEXT");
b.Property<Guid?>("UpdatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("UpdatedOn")
.HasColumnType("TEXT");
b.Property<Guid>("UserId")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("CreatedById");
b.HasIndex("GameId");
b.HasIndex("UpdatedById");
b.HasIndex("UserId");
b.ToTable("PlaySessions");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.Redistributable", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<Guid?>("CreatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedOn")
.HasColumnType("TEXT");
b.Property<string>("Description")
.HasColumnType("TEXT");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Notes")
.HasColumnType("TEXT");
b.Property<Guid?>("UpdatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("UpdatedOn")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("CreatedById");
b.HasIndex("UpdatedById");
b.ToTable("Redistributables");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.Role", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("TEXT");
b.Property<string>("Name")
.HasMaxLength(256)
.HasColumnType("TEXT");
b.Property<string>("NormalizedName")
.HasMaxLength(256)
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("NormalizedName")
.IsUnique()
.HasDatabaseName("RoleNameIndex");
b.ToTable("AspNetRoles", (string)null);
});
modelBuilder.Entity("LANCommander.Server.Data.Models.SavePath", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<Guid?>("CreatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedOn")
.HasColumnType("TEXT");
b.Property<Guid?>("GameId")
.HasColumnType("TEXT");
b.Property<bool>("IsRegex")
.HasColumnType("INTEGER");
b.Property<string>("Path")
.IsRequired()
.HasColumnType("TEXT");
b.Property<int>("Type")
.HasColumnType("INTEGER");
b.Property<Guid?>("UpdatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("UpdatedOn")
.HasColumnType("TEXT");
b.Property<string>("WorkingDirectory")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("CreatedById");
b.HasIndex("GameId");
b.HasIndex("UpdatedById");
b.ToTable("SavePaths");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.Script", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("Contents")
.IsRequired()
.HasColumnType("TEXT");
b.Property<Guid?>("CreatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedOn")
.HasColumnType("TEXT");
b.Property<string>("Description")
.HasColumnType("TEXT");
b.Property<Guid?>("GameId")
.HasColumnType("TEXT");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.Property<Guid?>("RedistributableId")
.HasColumnType("TEXT");
b.Property<bool>("RequiresAdmin")
.HasColumnType("INTEGER");
b.Property<Guid?>("ServerId")
.HasColumnType("TEXT");
b.Property<int>("Type")
.HasColumnType("INTEGER");
b.Property<Guid?>("UpdatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("UpdatedOn")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("CreatedById");
b.HasIndex("GameId");
b.HasIndex("RedistributableId");
b.HasIndex("ServerId");
b.HasIndex("UpdatedById");
b.ToTable("Scripts");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.Server", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("Arguments")
.IsRequired()
.HasColumnType("TEXT");
b.Property<bool>("Autostart")
.HasColumnType("INTEGER");
b.Property<int>("AutostartDelay")
.HasColumnType("INTEGER");
b.Property<int>("AutostartMethod")
.HasColumnType("INTEGER");
b.Property<Guid?>("CreatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedOn")
.HasColumnType("TEXT");
b.Property<Guid?>("GameId")
.HasColumnType("TEXT");
b.Property<string>("Host")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("OnStartScriptPath")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("OnStopScriptPath")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Path")
.IsRequired()
.HasColumnType("TEXT");
b.Property<int>("Port")
.HasColumnType("INTEGER");
b.Property<int>("ProcessTerminationMethod")
.HasColumnType("INTEGER");
b.Property<Guid?>("UpdatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("UpdatedOn")
.HasColumnType("TEXT");
b.Property<bool>("UseShellExecute")
.HasColumnType("INTEGER");
b.Property<string>("WorkingDirectory")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("CreatedById");
b.HasIndex("GameId");
b.HasIndex("UpdatedById");
b.ToTable("Servers");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.ServerConsole", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<Guid?>("CreatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedOn")
.HasColumnType("TEXT");
b.Property<string>("Host")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Password")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Path")
.IsRequired()
.HasColumnType("TEXT");
b.Property<int?>("Port")
.HasColumnType("INTEGER");
b.Property<Guid?>("ServerId")
.IsRequired()
.HasColumnType("TEXT");
b.Property<Guid?>("ServerId1")
.HasColumnType("TEXT");
b.Property<int>("Type")
.HasColumnType("INTEGER");
b.Property<Guid?>("UpdatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("UpdatedOn")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("CreatedById");
b.HasIndex("ServerId");
b.HasIndex("ServerId1");
b.HasIndex("UpdatedById");
b.ToTable("ServerConsoles");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.ServerHttpPath", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<Guid?>("CreatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedOn")
.HasColumnType("TEXT");
b.Property<string>("LocalPath")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Path")
.IsRequired()
.HasColumnType("TEXT");
b.Property<Guid>("ServerId")
.HasColumnType("TEXT");
b.Property<Guid?>("ServerId1")
.HasColumnType("TEXT");
b.Property<Guid?>("UpdatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("UpdatedOn")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("CreatedById");
b.HasIndex("ServerId");
b.HasIndex("ServerId1");
b.HasIndex("UpdatedById");
b.ToTable("ServerHttpPath");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.StorageLocation", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<Guid?>("CreatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedOn")
.HasColumnType("TEXT");
b.Property<bool>("Default")
.HasColumnType("INTEGER");
b.Property<string>("Path")
.IsRequired()
.HasColumnType("TEXT");
b.Property<int>("Type")
.HasColumnType("INTEGER");
b.Property<Guid?>("UpdatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("UpdatedOn")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("CreatedById");
b.HasIndex("UpdatedById");
b.ToTable("StorageLocations");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.Tag", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<Guid?>("CreatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedOn")
.HasColumnType("TEXT");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.Property<Guid?>("UpdatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("UpdatedOn")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("CreatedById");
b.HasIndex("UpdatedById");
b.ToTable("Tags");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.User", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<int>("AccessFailedCount")
.HasColumnType("INTEGER");
b.Property<string>("Alias")
.HasColumnType("TEXT");
b.Property<bool>("Approved")
.HasColumnType("INTEGER");
b.Property<DateTime?>("ApprovedOn")
.HasColumnType("TEXT");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("TEXT");
b.Property<string>("Email")
.HasMaxLength(256)
.HasColumnType("TEXT");
b.Property<bool>("EmailConfirmed")
.HasColumnType("INTEGER");
b.Property<bool>("LockoutEnabled")
.HasColumnType("INTEGER");
b.Property<DateTimeOffset?>("LockoutEnd")
.HasColumnType("TEXT");
b.Property<string>("NormalizedEmail")
.HasMaxLength(256)
.HasColumnType("TEXT");
b.Property<string>("NormalizedUserName")
.HasMaxLength(256)
.HasColumnType("TEXT");
b.Property<string>("PasswordHash")
.HasColumnType("TEXT");
b.Property<string>("PhoneNumber")
.HasColumnType("TEXT");
b.Property<bool>("PhoneNumberConfirmed")
.HasColumnType("INTEGER");
b.Property<string>("RefreshToken")
.HasColumnType("TEXT");
b.Property<DateTime>("RefreshTokenExpiration")
.HasColumnType("TEXT");
b.Property<string>("SecurityStamp")
.HasColumnType("TEXT");
b.Property<bool>("TwoFactorEnabled")
.HasColumnType("INTEGER");
b.Property<string>("UserName")
.HasMaxLength(256)
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("NormalizedEmail")
.HasDatabaseName("EmailIndex");
b.HasIndex("NormalizedUserName")
.IsUnique()
.HasDatabaseName("UserNameIndex");
b.ToTable("AspNetUsers", (string)null);
});
modelBuilder.Entity("LANCommander.Server.Data.Models.UserCustomField", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<Guid?>("CreatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedOn")
.HasColumnType("TEXT");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("TEXT");
b.Property<Guid?>("UpdatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("UpdatedOn")
.HasColumnType("TEXT");
b.Property<Guid?>("UserId")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Value")
.IsRequired()
.HasMaxLength(1024)
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("CreatedById");
b.HasIndex("UpdatedById");
b.HasIndex("UserId");
b.ToTable("UserCustomField");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<System.Guid>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("ClaimType")
.HasColumnType("TEXT");
b.Property<string>("ClaimValue")
.HasColumnType("TEXT");
b.Property<Guid>("RoleId")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("RoleId");
b.ToTable("AspNetRoleClaims", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<System.Guid>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("ClaimType")
.HasColumnType("TEXT");
b.Property<string>("ClaimValue")
.HasColumnType("TEXT");
b.Property<Guid>("UserId")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("UserId");
b.ToTable("AspNetUserClaims", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<System.Guid>", b =>
{
b.Property<string>("LoginProvider")
.HasMaxLength(128)
.HasColumnType("TEXT");
b.Property<string>("ProviderKey")
.HasMaxLength(128)
.HasColumnType("TEXT");
b.Property<string>("ProviderDisplayName")
.HasColumnType("TEXT");
b.Property<Guid>("UserId")
.HasColumnType("TEXT");
b.HasKey("LoginProvider", "ProviderKey");
b.HasIndex("UserId");
b.ToTable("AspNetUserLogins", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<System.Guid>", b =>
{
b.Property<Guid>("UserId")
.HasColumnType("TEXT");
b.Property<Guid>("RoleId")
.HasColumnType("TEXT");
b.HasKey("UserId", "RoleId");
b.HasIndex("RoleId");
b.ToTable("AspNetUserRoles", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<System.Guid>", b =>
{
b.Property<Guid>("UserId")
.HasColumnType("TEXT");
b.Property<string>("LoginProvider")
.HasMaxLength(128)
.HasColumnType("TEXT");
b.Property<string>("Name")
.HasMaxLength(128)
.HasColumnType("TEXT");
b.Property<string>("Value")
.HasColumnType("TEXT");
b.HasKey("UserId", "LoginProvider", "Name");
b.ToTable("AspNetUserTokens", (string)null);
});
modelBuilder.Entity("PageGame", b =>
{
b.Property<Guid>("GameId")
.HasColumnType("TEXT");
b.Property<Guid>("PageId")
.HasColumnType("TEXT");
b.HasKey("GameId", "PageId");
b.HasIndex("PageId");
b.ToTable("PageGame");
});
modelBuilder.Entity("PageRedistributable", b =>
{
b.Property<Guid>("PageId")
.HasColumnType("TEXT");
b.Property<Guid>("RedistributableId")
.HasColumnType("TEXT");
b.HasKey("PageId", "RedistributableId");
b.HasIndex("RedistributableId");
b.ToTable("PageRedistributable");
});
modelBuilder.Entity("PageServer", b =>
{
b.Property<Guid>("PageId")
.HasColumnType("TEXT");
b.Property<Guid>("ServerId")
.HasColumnType("TEXT");
b.HasKey("PageId", "ServerId");
b.HasIndex("ServerId");
b.ToTable("PageServer");
});
modelBuilder.Entity("RoleCollection", b =>
{
b.Property<Guid>("CollectionId")
.HasColumnType("TEXT");
b.Property<Guid>("RoleId")
.HasColumnType("TEXT");
b.HasKey("CollectionId", "RoleId");
b.HasIndex("RoleId");
b.ToTable("RoleCollection");
});
modelBuilder.Entity("CategoryGame", b =>
{
b.HasOne("LANCommander.Server.Data.Models.Category", null)
.WithMany()
.HasForeignKey("CategoriesId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("LANCommander.Server.Data.Models.Game", null)
.WithMany()
.HasForeignKey("GamesId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("CollectionGame", b =>
{
b.HasOne("LANCommander.Server.Data.Models.Collection", null)
.WithMany()
.HasForeignKey("CollectionId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("LANCommander.Server.Data.Models.Game", null)
.WithMany()
.HasForeignKey("GameId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("GameDeveloper", b =>
{
b.HasOne("LANCommander.Server.Data.Models.Company", null)
.WithMany()
.HasForeignKey("DeveloperId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("LANCommander.Server.Data.Models.Game", null)
.WithMany()
.HasForeignKey("GameId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("GameGenre", b =>
{
b.HasOne("LANCommander.Server.Data.Models.Game", null)
.WithMany()
.HasForeignKey("GamesId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("LANCommander.Server.Data.Models.Genre", null)
.WithMany()
.HasForeignKey("GenresId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("GamePlatform", b =>
{
b.HasOne("LANCommander.Server.Data.Models.Game", null)
.WithMany()
.HasForeignKey("GamesId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("LANCommander.Server.Data.Models.Platform", null)
.WithMany()
.HasForeignKey("PlatformsId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("GamePublisher", b =>
{
b.HasOne("LANCommander.Server.Data.Models.Game", null)
.WithMany()
.HasForeignKey("GameId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("LANCommander.Server.Data.Models.Company", null)
.WithMany()
.HasForeignKey("PublisherId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("GameRedistributable", b =>
{
b.HasOne("LANCommander.Server.Data.Models.Game", null)
.WithMany()
.HasForeignKey("GameId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("LANCommander.Server.Data.Models.Redistributable", null)
.WithMany()
.HasForeignKey("RedistributableId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("GameTag", b =>
{
b.HasOne("LANCommander.Server.Data.Models.Game", null)
.WithMany()
.HasForeignKey("GamesId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("LANCommander.Server.Data.Models.Tag", null)
.WithMany()
.HasForeignKey("TagsId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("LANCommander.Server.Data.Models.Action", b =>
{
b.HasOne("LANCommander.Server.Data.Models.User", "CreatedBy")
.WithMany()
.HasForeignKey("CreatedById")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("LANCommander.Server.Data.Models.Game", "Game")
.WithMany("Actions")
.HasForeignKey("GameId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("LANCommander.Server.Data.Models.Server", "Server")
.WithMany("Actions")
.HasForeignKey("ServerId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("LANCommander.Server.Data.Models.User", "UpdatedBy")
.WithMany()
.HasForeignKey("UpdatedById")
.OnDelete(DeleteBehavior.SetNull);
b.Navigation("CreatedBy");
b.Navigation("Game");
b.Navigation("Server");
b.Navigation("UpdatedBy");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.Archive", b =>
{
b.HasOne("LANCommander.Server.Data.Models.User", "CreatedBy")
.WithMany()
.HasForeignKey("CreatedById")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("LANCommander.Server.Data.Models.Game", "Game")
.WithMany("Archives")
.HasForeignKey("GameId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("LANCommander.Server.Data.Models.Archive", "LastVersion")
.WithMany()
.HasForeignKey("LastVersionId");
b.HasOne("LANCommander.Server.Data.Models.Redistributable", "Redistributable")
.WithMany("Archives")
.HasForeignKey("RedistributableId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("LANCommander.Server.Data.Models.StorageLocation", "StorageLocation")
.WithMany("Archives")
.HasForeignKey("StorageLocationId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("LANCommander.Server.Data.Models.User", "UpdatedBy")
.WithMany()
.HasForeignKey("UpdatedById")
.OnDelete(DeleteBehavior.SetNull);
b.Navigation("CreatedBy");
b.Navigation("Game");
b.Navigation("LastVersion");
b.Navigation("Redistributable");
b.Navigation("StorageLocation");
b.Navigation("UpdatedBy");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.Category", b =>
{
b.HasOne("LANCommander.Server.Data.Models.User", "CreatedBy")
.WithMany()
.HasForeignKey("CreatedById")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("LANCommander.Server.Data.Models.Category", "Parent")
.WithMany("Children")
.HasForeignKey("ParentId");
b.HasOne("LANCommander.Server.Data.Models.User", "UpdatedBy")
.WithMany()
.HasForeignKey("UpdatedById")
.OnDelete(DeleteBehavior.SetNull);
b.Navigation("CreatedBy");
b.Navigation("Parent");
b.Navigation("UpdatedBy");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.Collection", b =>
{
b.HasOne("LANCommander.Server.Data.Models.User", "CreatedBy")
.WithMany()
.HasForeignKey("CreatedById")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("LANCommander.Server.Data.Models.User", "UpdatedBy")
.WithMany()
.HasForeignKey("UpdatedById")
.OnDelete(DeleteBehavior.SetNull);
b.Navigation("CreatedBy");
b.Navigation("UpdatedBy");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.Company", b =>
{
b.HasOne("LANCommander.Server.Data.Models.User", "CreatedBy")
.WithMany()
.HasForeignKey("CreatedById")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("LANCommander.Server.Data.Models.User", "UpdatedBy")
.WithMany()
.HasForeignKey("UpdatedById")
.OnDelete(DeleteBehavior.SetNull);
b.Navigation("CreatedBy");
b.Navigation("UpdatedBy");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.Engine", b =>
{
b.HasOne("LANCommander.Server.Data.Models.User", "CreatedBy")
.WithMany()
.HasForeignKey("CreatedById");
b.HasOne("LANCommander.Server.Data.Models.User", "UpdatedBy")
.WithMany()
.HasForeignKey("UpdatedById");
b.Navigation("CreatedBy");
b.Navigation("UpdatedBy");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.Game", b =>
{
b.HasOne("LANCommander.Server.Data.Models.Game", "BaseGame")
.WithMany("DependentGames")
.HasForeignKey("BaseGameId")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("LANCommander.Server.Data.Models.User", "CreatedBy")
.WithMany()
.HasForeignKey("CreatedById")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("LANCommander.Server.Data.Models.Engine", "Engine")
.WithMany("Games")
.HasForeignKey("EngineId")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("LANCommander.Server.Data.Models.User", "UpdatedBy")
.WithMany()
.HasForeignKey("UpdatedById")
.OnDelete(DeleteBehavior.SetNull);
b.Navigation("BaseGame");
b.Navigation("CreatedBy");
b.Navigation("Engine");
b.Navigation("UpdatedBy");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.GameSave", b =>
{
b.HasOne("LANCommander.Server.Data.Models.User", "CreatedBy")
.WithMany()
.HasForeignKey("CreatedById")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("LANCommander.Server.Data.Models.Game", "Game")
.WithMany("GameSaves")
.HasForeignKey("GameId")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("LANCommander.Server.Data.Models.StorageLocation", "StorageLocation")
.WithMany("GameSaves")
.HasForeignKey("StorageLocationId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("LANCommander.Server.Data.Models.User", "UpdatedBy")
.WithMany()
.HasForeignKey("UpdatedById")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("LANCommander.Server.Data.Models.User", "User")
.WithMany("GameSaves")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CreatedBy");
b.Navigation("Game");
b.Navigation("StorageLocation");
b.Navigation("UpdatedBy");
b.Navigation("User");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.Genre", b =>
{
b.HasOne("LANCommander.Server.Data.Models.User", "CreatedBy")
.WithMany()
.HasForeignKey("CreatedById")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("LANCommander.Server.Data.Models.User", "UpdatedBy")
.WithMany()
.HasForeignKey("UpdatedById")
.OnDelete(DeleteBehavior.SetNull);
b.Navigation("CreatedBy");
b.Navigation("UpdatedBy");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.Issue", b =>
{
b.HasOne("LANCommander.Server.Data.Models.User", "CreatedBy")
.WithMany()
.HasForeignKey("CreatedById")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("LANCommander.Server.Data.Models.Game", "Game")
.WithMany("Issues")
.HasForeignKey("GameId")
.OnDelete(DeleteBehavior.SetNull)
.IsRequired();
b.HasOne("LANCommander.Server.Data.Models.User", "ResolvedBy")
.WithMany()
.HasForeignKey("ResolvedById");
b.HasOne("LANCommander.Server.Data.Models.User", "UpdatedBy")
.WithMany()
.HasForeignKey("UpdatedById")
.OnDelete(DeleteBehavior.SetNull);
b.Navigation("CreatedBy");
b.Navigation("Game");
b.Navigation("ResolvedBy");
b.Navigation("UpdatedBy");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.Key", b =>
{
b.HasOne("LANCommander.Server.Data.Models.User", "ClaimedByUser")
.WithMany()
.HasForeignKey("ClaimedByUserId");
b.HasOne("LANCommander.Server.Data.Models.User", "CreatedBy")
.WithMany()
.HasForeignKey("CreatedById")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("LANCommander.Server.Data.Models.Game", "Game")
.WithMany("Keys")
.HasForeignKey("GameId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("LANCommander.Server.Data.Models.User", "UpdatedBy")
.WithMany()
.HasForeignKey("UpdatedById")
.OnDelete(DeleteBehavior.SetNull);
b.Navigation("ClaimedByUser");
b.Navigation("CreatedBy");
b.Navigation("Game");
b.Navigation("UpdatedBy");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.Media", b =>
{
b.HasOne("LANCommander.Server.Data.Models.User", "CreatedBy")
.WithMany()
.HasForeignKey("CreatedById")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("LANCommander.Server.Data.Models.Game", "Game")
.WithMany("Media")
.HasForeignKey("GameId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("LANCommander.Server.Data.Models.StorageLocation", "StorageLocation")
.WithMany("Media")
.HasForeignKey("StorageLocationId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("LANCommander.Server.Data.Models.Media", "Thumbnail")
.WithOne("Parent")
.HasForeignKey("LANCommander.Server.Data.Models.Media", "ThumbnailId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("LANCommander.Server.Data.Models.User", "UpdatedBy")
.WithMany()
.HasForeignKey("UpdatedById")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("LANCommander.Server.Data.Models.User", "User")
.WithMany("Media")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade);
b.Navigation("CreatedBy");
b.Navigation("Game");
b.Navigation("StorageLocation");
b.Navigation("Thumbnail");
b.Navigation("UpdatedBy");
b.Navigation("User");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.MultiplayerMode", b =>
{
b.HasOne("LANCommander.Server.Data.Models.User", "CreatedBy")
.WithMany()
.HasForeignKey("CreatedById")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("LANCommander.Server.Data.Models.Game", "Game")
.WithMany("MultiplayerModes")
.HasForeignKey("GameId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("LANCommander.Server.Data.Models.User", "UpdatedBy")
.WithMany()
.HasForeignKey("UpdatedById")
.OnDelete(DeleteBehavior.SetNull);
b.Navigation("CreatedBy");
b.Navigation("Game");
b.Navigation("UpdatedBy");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.Page", b =>
{
b.HasOne("LANCommander.Server.Data.Models.User", "CreatedBy")
.WithMany()
.HasForeignKey("CreatedById")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("LANCommander.Server.Data.Models.Page", "Parent")
.WithMany("Children")
.HasForeignKey("ParentId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("LANCommander.Server.Data.Models.User", "UpdatedBy")
.WithMany()
.HasForeignKey("UpdatedById")
.OnDelete(DeleteBehavior.SetNull);
b.Navigation("CreatedBy");
b.Navigation("Parent");
b.Navigation("UpdatedBy");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.Platform", b =>
{
b.HasOne("LANCommander.Server.Data.Models.User", "CreatedBy")
.WithMany()
.HasForeignKey("CreatedById")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("LANCommander.Server.Data.Models.User", "UpdatedBy")
.WithMany()
.HasForeignKey("UpdatedById")
.OnDelete(DeleteBehavior.SetNull);
b.Navigation("CreatedBy");
b.Navigation("UpdatedBy");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.PlaySession", b =>
{
b.HasOne("LANCommander.Server.Data.Models.User", "CreatedBy")
.WithMany()
.HasForeignKey("CreatedById")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("LANCommander.Server.Data.Models.Game", "Game")
.WithMany("PlaySessions")
.HasForeignKey("GameId")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("LANCommander.Server.Data.Models.User", "UpdatedBy")
.WithMany()
.HasForeignKey("UpdatedById")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("LANCommander.Server.Data.Models.User", "User")
.WithMany("PlaySessions")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CreatedBy");
b.Navigation("Game");
b.Navigation("UpdatedBy");
b.Navigation("User");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.Redistributable", b =>
{
b.HasOne("LANCommander.Server.Data.Models.User", "CreatedBy")
.WithMany()
.HasForeignKey("CreatedById")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("LANCommander.Server.Data.Models.User", "UpdatedBy")
.WithMany()
.HasForeignKey("UpdatedById")
.OnDelete(DeleteBehavior.SetNull);
b.Navigation("CreatedBy");
b.Navigation("UpdatedBy");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.SavePath", b =>
{
b.HasOne("LANCommander.Server.Data.Models.User", "CreatedBy")
.WithMany()
.HasForeignKey("CreatedById")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("LANCommander.Server.Data.Models.Game", "Game")
.WithMany("SavePaths")
.HasForeignKey("GameId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("LANCommander.Server.Data.Models.User", "UpdatedBy")
.WithMany()
.HasForeignKey("UpdatedById")
.OnDelete(DeleteBehavior.SetNull);
b.Navigation("CreatedBy");
b.Navigation("Game");
b.Navigation("UpdatedBy");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.Script", b =>
{
b.HasOne("LANCommander.Server.Data.Models.User", "CreatedBy")
.WithMany()
.HasForeignKey("CreatedById")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("LANCommander.Server.Data.Models.Game", "Game")
.WithMany("Scripts")
.HasForeignKey("GameId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("LANCommander.Server.Data.Models.Redistributable", "Redistributable")
.WithMany("Scripts")
.HasForeignKey("RedistributableId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("LANCommander.Server.Data.Models.Server", "Server")
.WithMany("Scripts")
.HasForeignKey("ServerId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("LANCommander.Server.Data.Models.User", "UpdatedBy")
.WithMany()
.HasForeignKey("UpdatedById")
.OnDelete(DeleteBehavior.SetNull);
b.Navigation("CreatedBy");
b.Navigation("Game");
b.Navigation("Redistributable");
b.Navigation("Server");
b.Navigation("UpdatedBy");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.Server", b =>
{
b.HasOne("LANCommander.Server.Data.Models.User", "CreatedBy")
.WithMany()
.HasForeignKey("CreatedById")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("LANCommander.Server.Data.Models.Game", "Game")
.WithMany("Servers")
.HasForeignKey("GameId")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("LANCommander.Server.Data.Models.User", "UpdatedBy")
.WithMany()
.HasForeignKey("UpdatedById")
.OnDelete(DeleteBehavior.SetNull);
b.Navigation("CreatedBy");
b.Navigation("Game");
b.Navigation("UpdatedBy");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.ServerConsole", b =>
{
b.HasOne("LANCommander.Server.Data.Models.User", "CreatedBy")
.WithMany()
.HasForeignKey("CreatedById")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("LANCommander.Server.Data.Models.Server", "Server")
.WithMany()
.HasForeignKey("ServerId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("LANCommander.Server.Data.Models.Server", null)
.WithMany("ServerConsoles")
.HasForeignKey("ServerId1");
b.HasOne("LANCommander.Server.Data.Models.User", "UpdatedBy")
.WithMany()
.HasForeignKey("UpdatedById")
.OnDelete(DeleteBehavior.SetNull);
b.Navigation("CreatedBy");
b.Navigation("Server");
b.Navigation("UpdatedBy");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.ServerHttpPath", b =>
{
b.HasOne("LANCommander.Server.Data.Models.User", "CreatedBy")
.WithMany()
.HasForeignKey("CreatedById")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("LANCommander.Server.Data.Models.Server", "Server")
.WithMany()
.HasForeignKey("ServerId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("LANCommander.Server.Data.Models.Server", null)
.WithMany("HttpPaths")
.HasForeignKey("ServerId1");
b.HasOne("LANCommander.Server.Data.Models.User", "UpdatedBy")
.WithMany()
.HasForeignKey("UpdatedById")
.OnDelete(DeleteBehavior.SetNull);
b.Navigation("CreatedBy");
b.Navigation("Server");
b.Navigation("UpdatedBy");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.StorageLocation", b =>
{
b.HasOne("LANCommander.Server.Data.Models.User", "CreatedBy")
.WithMany()
.HasForeignKey("CreatedById");
b.HasOne("LANCommander.Server.Data.Models.User", "UpdatedBy")
.WithMany()
.HasForeignKey("UpdatedById");
b.Navigation("CreatedBy");
b.Navigation("UpdatedBy");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.Tag", b =>
{
b.HasOne("LANCommander.Server.Data.Models.User", "CreatedBy")
.WithMany()
.HasForeignKey("CreatedById")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("LANCommander.Server.Data.Models.User", "UpdatedBy")
.WithMany()
.HasForeignKey("UpdatedById")
.OnDelete(DeleteBehavior.SetNull);
b.Navigation("CreatedBy");
b.Navigation("UpdatedBy");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.UserCustomField", b =>
{
b.HasOne("LANCommander.Server.Data.Models.User", "CreatedBy")
.WithMany()
.HasForeignKey("CreatedById");
b.HasOne("LANCommander.Server.Data.Models.User", "UpdatedBy")
.WithMany()
.HasForeignKey("UpdatedById");
b.HasOne("LANCommander.Server.Data.Models.User", "User")
.WithMany("CustomFields")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CreatedBy");
b.Navigation("UpdatedBy");
b.Navigation("User");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<System.Guid>", b =>
{
b.HasOne("LANCommander.Server.Data.Models.Role", null)
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<System.Guid>", b =>
{
b.HasOne("LANCommander.Server.Data.Models.User", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<System.Guid>", b =>
{
b.HasOne("LANCommander.Server.Data.Models.User", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<System.Guid>", b =>
{
b.HasOne("LANCommander.Server.Data.Models.Role", null)
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("LANCommander.Server.Data.Models.User", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<System.Guid>", b =>
{
b.HasOne("LANCommander.Server.Data.Models.User", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("PageGame", b =>
{
b.HasOne("LANCommander.Server.Data.Models.Game", null)
.WithMany()
.HasForeignKey("GameId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("LANCommander.Server.Data.Models.Page", null)
.WithMany()
.HasForeignKey("PageId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("PageRedistributable", b =>
{
b.HasOne("LANCommander.Server.Data.Models.Page", null)
.WithMany()
.HasForeignKey("PageId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("LANCommander.Server.Data.Models.Redistributable", null)
.WithMany()
.HasForeignKey("RedistributableId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("PageServer", b =>
{
b.HasOne("LANCommander.Server.Data.Models.Page", null)
.WithMany()
.HasForeignKey("PageId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("LANCommander.Server.Data.Models.Server", null)
.WithMany()
.HasForeignKey("ServerId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("RoleCollection", b =>
{
b.HasOne("LANCommander.Server.Data.Models.Collection", null)
.WithMany()
.HasForeignKey("CollectionId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("LANCommander.Server.Data.Models.Role", null)
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("LANCommander.Server.Data.Models.Category", b =>
{
b.Navigation("Children");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.Engine", b =>
{
b.Navigation("Games");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.Game", b =>
{
b.Navigation("Actions");
b.Navigation("Archives");
b.Navigation("DependentGames");
b.Navigation("GameSaves");
b.Navigation("Issues");
b.Navigation("Keys");
b.Navigation("Media");
b.Navigation("MultiplayerModes");
b.Navigation("PlaySessions");
b.Navigation("SavePaths");
b.Navigation("Scripts");
b.Navigation("Servers");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.Media", b =>
{
b.Navigation("Parent");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.Page", b =>
{
b.Navigation("Children");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.Redistributable", b =>
{
b.Navigation("Archives");
b.Navigation("Scripts");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.Server", b =>
{
b.Navigation("Actions");
b.Navigation("HttpPaths");
b.Navigation("Scripts");
b.Navigation("ServerConsoles");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.StorageLocation", b =>
{
b.Navigation("Archives");
b.Navigation("GameSaves");
b.Navigation("Media");
});
modelBuilder.Entity("LANCommander.Server.Data.Models.User", b =>
{
b.Navigation("CustomFields");
b.Navigation("GameSaves");
b.Navigation("Media");
b.Navigation("PlaySessions");
});
#pragma warning restore 612, 618
}
|
/// <inheritdoc />
|
https://github.com/LANCommander/LANCommander/blob/51bc43ac93e3008391a2c78f958cbfc1d108bd80/LANCommander.Server.Data.SQLite/Migrations/20241011014752_AddStorageLocations.Designer.cs#L18-L2573
|
51bc43ac93e3008391a2c78f958cbfc1d108bd80
|
LANCommander
|
github_2023
|
LANCommander
|
csharp
|
AddCollections.Up
|
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Collections",
columns: table => new
{
Id = table.Column<Guid>(type: "TEXT", nullable: false),
Name = table.Column<string>(type: "TEXT", nullable: false),
CreatedOn = table.Column<DateTime>(type: "TEXT", nullable: false),
CreatedById = table.Column<Guid>(type: "TEXT", nullable: true),
UpdatedOn = table.Column<DateTime>(type: "TEXT", nullable: false),
UpdatedById = table.Column<Guid>(type: "TEXT", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Collections", x => x.Id);
table.ForeignKey(
name: "FK_Collections_AspNetUsers_CreatedById",
column: x => x.CreatedById,
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
table.ForeignKey(
name: "FK_Collections_AspNetUsers_UpdatedById",
column: x => x.UpdatedById,
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
});
migrationBuilder.CreateTable(
name: "CollectionGame",
columns: table => new
{
CollectionId = table.Column<Guid>(type: "TEXT", nullable: false),
GameId = table.Column<Guid>(type: "TEXT", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_CollectionGame", x => new { x.CollectionId, x.GameId });
table.ForeignKey(
name: "FK_CollectionGame_Collections_CollectionId",
column: x => x.CollectionId,
principalTable: "Collections",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_CollectionGame_Games_GameId",
column: x => x.GameId,
principalTable: "Games",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "RoleCollection",
columns: table => new
{
CollectionId = table.Column<Guid>(type: "TEXT", nullable: false),
RoleId = table.Column<Guid>(type: "TEXT", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_RoleCollection", x => new { x.CollectionId, x.RoleId });
table.ForeignKey(
name: "FK_RoleCollection_AspNetRoles_RoleId",
column: x => x.RoleId,
principalTable: "AspNetRoles",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_RoleCollection_Collections_CollectionId",
column: x => x.CollectionId,
principalTable: "Collections",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_CollectionGame_GameId",
table: "CollectionGame",
column: "GameId");
migrationBuilder.CreateIndex(
name: "IX_Collections_CreatedById",
table: "Collections",
column: "CreatedById");
migrationBuilder.CreateIndex(
name: "IX_Collections_UpdatedById",
table: "Collections",
column: "UpdatedById");
migrationBuilder.CreateIndex(
name: "IX_RoleCollection_RoleId",
table: "RoleCollection",
column: "RoleId");
}
|
/// <inheritdoc />
|
https://github.com/LANCommander/LANCommander/blob/51bc43ac93e3008391a2c78f958cbfc1d108bd80/LANCommander.Server.Data.SQLite/Migrations/20231204044928_AddCollections.cs#L12-L109
|
51bc43ac93e3008391a2c78f958cbfc1d108bd80
|
handy
|
github_2023
|
Shopify
|
csharp
|
CylinderSurface.TransformScale
|
private float TransformScale(float val)
{
return val * _cylinder.transform.lossyScale.x;
}
|
/// <summary>
/// Local to world transformation of a float, assuming uniform scale.
/// </summary>
|
https://github.com/Shopify/handy/blob/fa8686c291b1fe80e695bd8ad2474e2e852fd58b/Handy/Assets/Oculus/Interaction/Runtime/Scripts/Interaction/Surfaces/CylinderSurface.cs#L225-L228
|
fa8686c291b1fe80e695bd8ad2474e2e852fd58b
|
handy
|
github_2023
|
Shopify
|
csharp
|
VoipOptions.SetBitrateForNewConnections
|
public void SetBitrateForNewConnections(VoipBitrate value) {
CAPI.ovr_VoipOptions_SetBitrateForNewConnections(Handle, value);
}
|
/// Sets the maximum average bitrate the audio codec should use. Higher
/// bitrates will increase audio quality at the expense of increased network
/// usage. Use a lower bitrate if you think the quality is good but the network
/// usage is too much. Use a higher bitrate if you think the quality is bad and
/// you can afford to have a large streaming bitrate.
|
https://github.com/Shopify/handy/blob/fa8686c291b1fe80e695bd8ad2474e2e852fd58b/Handy/Assets/Oculus/Platform/Scripts/VoipOptions.cs#L22-L24
|
fa8686c291b1fe80e695bd8ad2474e2e852fd58b
|
handy
|
github_2023
|
Shopify
|
csharp
|
AdvancedAbuseReportOptions.SetObjectType
|
public void SetObjectType(string value) {
CAPI.ovr_AdvancedAbuseReportOptions_SetObjectType(Handle, value);
}
|
/// If report_type is content, a string representing the type of content being
/// reported. This should correspond to the object_type string used in the UI
|
https://github.com/Shopify/handy/blob/fa8686c291b1fe80e695bd8ad2474e2e852fd58b/Handy/Assets/Oculus/Platform/Scripts/AdvancedAbuseReportOptions.cs#L27-L29
|
fa8686c291b1fe80e695bd8ad2474e2e852fd58b
|
handy
|
github_2023
|
Shopify
|
csharp
|
OVRExtensions.ToTrackingSpacePose
|
public static OVRPose ToTrackingSpacePose(this Transform transform, Camera camera)
{
// Initializing to identity, but for all Oculus headsets, down below the pose will be initialized to the runtime's pose value, so identity will never be returned.
OVRPose headPose = OVRPose.identity;
Vector3 pos;
Quaternion rot;
if (OVRNodeStateProperties.GetNodeStatePropertyVector3(Node.Head, NodeStatePropertyType.Position, OVRPlugin.Node.Head, OVRPlugin.Step.Render, out pos))
headPose.position = pos;
if (OVRNodeStateProperties.GetNodeStatePropertyQuaternion(Node.Head, NodeStatePropertyType.Orientation, OVRPlugin.Node.Head, OVRPlugin.Step.Render, out rot))
headPose.orientation = rot;
var ret = headPose * transform.ToHeadSpacePose(camera);
return ret;
}
|
/// <summary>
/// Converts the given world-space transform to an OVRPose in tracking space.
/// </summary>
|
https://github.com/Shopify/handy/blob/fa8686c291b1fe80e695bd8ad2474e2e852fd58b/Handy/Assets/Oculus/VR/Scripts/OVRCommon.cs#L52-L67
|
fa8686c291b1fe80e695bd8ad2474e2e852fd58b
|
handy
|
github_2023
|
Shopify
|
csharp
|
WitEditorUI.LayoutHeaderButton
|
public static void LayoutHeaderButton(Texture2D headerTexture, string headerURL)
{
if (headerTexture != null)
{
GUILayout.BeginHorizontal();
GUILayout.FlexibleSpace();
float maxWidth = EditorGUIUtility.currentViewWidth - WitStyles.WindowPaddingLeft - WitStyles.WindowPaddingRight - WitStyles.IconButton.CalcSize(WitStyles.HelpIcon).x;
float headerWidth = Mathf.Min(WitStyles.HeaderWidth, maxWidth);
float headerHeight = headerWidth * (float)headerTexture.height / (float)headerTexture.width;
if (GUILayout.Button(headerTexture, WitStyles.HeaderButton, GUILayout.Width(headerWidth), GUILayout.Height(headerHeight)) && !string.IsNullOrEmpty(headerURL))
{
Application.OpenURL(headerURL);
}
GUILayout.FlexibleSpace();
if (LayoutIconButton(WitStyles.HelpIcon))
{
Application.OpenURL(headerURL);
}
GUILayout.EndHorizontal();
}
}
|
// Layout header button
|
https://github.com/Shopify/handy/blob/fa8686c291b1fe80e695bd8ad2474e2e852fd58b/Handy/Assets/Oculus/Voice/Lib/Wit.ai/Scripts/Editor/WitEditorUI.cs#L115-L135
|
fa8686c291b1fe80e695bd8ad2474e2e852fd58b
|
handy
|
github_2023
|
Shopify
|
csharp
|
AssetDatabaseUtility.FindUnityAsset
|
public static T FindUnityAsset<T>(string filter) where T : UnityEngine.Object
{
T[] results = FindUnityAssets<T>(filter, true);
if (results != null && results.Length > 0)
{
return results[0];
}
return null;
}
|
// Find Unity asset
|
https://github.com/Shopify/handy/blob/fa8686c291b1fe80e695bd8ad2474e2e852fd58b/Handy/Assets/Oculus/Voice/Lib/Wit.ai/Scripts/Editor/Utility/AssetDatabaseUtility.cs#L17-L25
|
fa8686c291b1fe80e695bd8ad2474e2e852fd58b
|
oni_multiplayer
|
github_2023
|
onimp
|
csharp
|
DisablePopUpEffects.TargetMethods
|
private static IEnumerable<MethodBase> TargetMethods() =>
typeof(PopFXManager).GetMethods()
.Where(it => it.Name.StartsWith("SpawnFX"));
|
// ReSharper disable once UnusedMember.Local
|
https://github.com/onimp/oni_multiplayer/blob/926abd3b5f177b12ab4cc6d6aa537dcdb09684b7/src/MultiplayerMod/Game/Effects/DisablePopUpEffects.cs#L15-L17
|
926abd3b5f177b12ab4cc6d6aa537dcdb09684b7
|
NectarRCON
|
github_2023
|
zkhssb
|
csharp
|
DNSHelperTests.ATest
|
[TestMethod]
public void ATest()
{
string? ip = DNSHelpers.AQuery("hypixel.net");
Console.WriteLine(ip);
Assert.IsNotNull(string.IsNullOrEmpty(ip));
}
|
/// <summary>
/// A解析测试
/// </summary>
|
https://github.com/zkhssb/NectarRCON/blob/e7349a9bd8533522b7c105fe3e0ab79325ad8e05/NectarRCON.Tests/DNSHelperTests.cs#L10-L16
|
e7349a9bd8533522b7c105fe3e0ab79325ad8e05
|
NectarRCON
|
github_2023
|
zkhssb
|
csharp
|
GithubUpdater.GetLatestVersion
|
private AppVersion? GetLatestVersion(bool enablePre)
{
if (_version is null)
return null;
using(HttpRequestMessage request = new(HttpMethod.Get, "releases/latest"))
{
request.Headers.Add("User-Agent", $"{_version.AppName}-AppUpdater");
using(HttpResponseMessage response = _client.Send(request))
{
if (!response.IsSuccessStatusCode)
throw new HttpRequestException(response.StatusCode.ToString());
string resultString = string.Empty;
Task.Run(async () =>
{
resultString = await response.Content.ReadAsStringAsync();
}).Wait();
Release release = JsonSerializer.Deserialize<Release>(resultString) ?? throw new JsonException();
foreach(var asset in release.Assets)
{
string fileName = Path.GetFileNameWithoutExtension(asset.Name);
try
{
fileName = "NectarRcon-x86-1.0.0-beta2";
AppVersion version = AppVersion.ParseVersion(fileName);
if(version.AppName.ToLower() == _version.AppName.ToLower() && version.Platform.ToLower() == _version.Platform.ToLower())
{
if (version.IsPreRelease && !enablePre)
continue;
if (version > _version)
{
return version;
}
}
}
catch (InvalidOperationException) { } // Invalid version format
}
return null;
}
}
}
|
/// <summary>
/// 获取最新版本, null为没找到
/// </summary>
/// <param name="enablePre">是否允许pre版本</param>
|
https://github.com/zkhssb/NectarRCON/blob/e7349a9bd8533522b7c105fe3e0ab79325ad8e05/NectarRCON.Updater/GithubUpdater.cs#L24-L63
|
e7349a9bd8533522b7c105fe3e0ab79325ad8e05
|
SmartObjectSync
|
github_2023
|
MMMaellon
|
csharp
|
UniTaskExtensions.AsUniTask
|
public static UniTask<T> AsUniTask<T>(this Task<T> task, bool useCurrentSynchronizationContext = true)
{
var promise = new UniTaskCompletionSource<T>();
task.ContinueWith((x, state) =>
{
var p = (UniTaskCompletionSource<T>)state;
switch (x.Status)
{
case TaskStatus.Canceled:
p.TrySetCanceled();
break;
case TaskStatus.Faulted:
p.TrySetException(x.Exception);
break;
case TaskStatus.RanToCompletion:
p.TrySetResult(x.Result);
break;
default:
throw new NotSupportedException();
}
}, promise, useCurrentSynchronizationContext ? TaskScheduler.FromCurrentSynchronizationContext() : TaskScheduler.Current);
return promise.Task;
}
|
/// <summary>
/// Convert Task[T] -> UniTask[T].
/// </summary>
|
https://github.com/MMMaellon/SmartObjectSync/blob/f600f5a5df125ac4e01d35c43ed60d0d2b3c0594/Packages/com.vrchat.base/Runtime/VRCSDK/Plugins/UniTask/Runtime/UniTaskExtensions.cs#L17-L42
|
f600f5a5df125ac4e01d35c43ed60d0d2b3c0594
|
SmartObjectSync
|
github_2023
|
MMMaellon
|
csharp
|
UnityBindingExtensions.BindTo
|
public static void BindTo<TSource, TObject>(this IUniTaskAsyncEnumerable<TSource> source, TObject monoBehaviour, Action<TObject, TSource> bindAction, bool rebindOnError = true)
where TObject : MonoBehaviour
{
BindToCore(source, monoBehaviour, bindAction, monoBehaviour.GetCancellationTokenOnDestroy(), rebindOnError).Forget();
}
|
// <T> -> Action
|
https://github.com/MMMaellon/SmartObjectSync/blob/f600f5a5df125ac4e01d35c43ed60d0d2b3c0594/Packages/com.vrchat.base/Runtime/VRCSDK/Plugins/UniTask/Runtime/UnityBindingExtensions.cs#L190-L194
|
f600f5a5df125ac4e01d35c43ed60d0d2b3c0594
|
SmartObjectSync
|
github_2023
|
MMMaellon
|
csharp
|
AsyncUniTaskVoid.GetStatus
|
UniTaskStatus IUniTaskSource.GetStatus(short token)
{
return UniTaskStatus.Pending;
}
|
// dummy interface implementation for TaskTracker.
|
https://github.com/MMMaellon/SmartObjectSync/blob/f600f5a5df125ac4e01d35c43ed60d0d2b3c0594/Packages/com.vrchat.base/Runtime/VRCSDK/Plugins/UniTask/Runtime/CompilerServices/StateMachineRunner.cs#L109-L112
|
f600f5a5df125ac4e01d35c43ed60d0d2b3c0594
|
SmartObjectSync
|
github_2023
|
MMMaellon
|
csharp
|
WeakGenericCollectionFormatter.GetUninitializedObject
|
protected override object GetUninitializedObject()
{
return Activator.CreateInstance(this.SerializedType);
}
|
/// <summary>
/// Gets a new object of type <see cref="T" />.
/// </summary>
/// <returns>
/// A new object of type <see cref="T" />.
/// </returns>
|
https://github.com/MMMaellon/SmartObjectSync/blob/f600f5a5df125ac4e01d35c43ed60d0d2b3c0594/Packages/com.vrchat.worlds/Runtime/Udon/Serialization/OdinSerializer/Core/Formatters/GenericCollectionFormatter.cs#L229-L232
|
f600f5a5df125ac4e01d35c43ed60d0d2b3c0594
|
SmartObjectSync
|
github_2023
|
MMMaellon
|
csharp
|
MethodInfoFormatter.DeserializeImplementation
|
protected override void DeserializeImplementation(ref T value, IDataReader reader)
{
#if false //vrc security patch
string name;
EntryType entry;
entry = reader.PeekEntry(out name);
if (entry == EntryType.StartOfArray)
{
// We have legacy ISerializable data for the MethodInfo, since in no case will data written by this formatter ever start with an array.
// In this case, get the proper legacy formatter for this type and read the data using that.
IFormatter serializableFormatter;
serializableFormatter = new WeakSerializableFormatter(typeof(T));
value = (T)(object)serializableFormatter.Deserialize(reader);
return;
}
Type declaringType = null;
string methodName = null;
Type[] signature = null;
Type[] genericArguments = null;
while ((entry = reader.PeekEntry(out name)) != EntryType.EndOfNode && entry != EntryType.EndOfArray && entry != EntryType.EndOfStream)
{
switch (name)
{
case "declaringType":
{
var t = TypeSerializer.ReadValue(reader);
if (t != null)
{
declaringType = t;
}
}
break;
case "methodName":
{
methodName = StringSerializer.ReadValue(reader);
}
break;
case "signature":
{
signature = TypeArraySerializer.ReadValue(reader);
}
break;
case "genericArguments":
{
genericArguments = TypeArraySerializer.ReadValue(reader);
}
break;
default:
reader.SkipEntry();
break;
}
}
if (declaringType == null)
{
reader.Context.Config.DebugContext.LogWarning("Missing declaring type of MethodInfo on deserialize.");
return;
}
if (methodName == null)
{
reader.Context.Config.DebugContext.LogError("Missing method name of MethodInfo on deserialize.");
return;
}
MethodInfo methodInfo;
bool useSignature = false;
bool wasAmbiguous = false;
if (signature != null)
{
useSignature = true;
for (int i = 0; i < signature.Length; i++)
{
if (signature[i] == null)
{
useSignature = false;
break;
}
}
}
if (useSignature)
{
try
{
methodInfo = declaringType.GetMethod(methodName, Flags.AllMembers, null, signature, null);
}
catch (AmbiguousMatchException)
{
methodInfo = null;
wasAmbiguous = true;
}
}
else
{
try
{
methodInfo = declaringType.GetMethod(methodName, Flags.AllMembers);
}
catch (AmbiguousMatchException)
{
methodInfo = null;
wasAmbiguous = true;
}
}
if (methodInfo == null)
{
if (useSignature)
{
reader.Context.Config.DebugContext.LogWarning("Could not find method with signature " + name + "(" + string.Join(", ", signature.Select(p => p.GetNiceFullName()).ToArray()) + ") on type '" + declaringType.FullName + (wasAmbiguous ? "; resolution was ambiguous between multiple methods" : string.Empty) + ".");
}
else
{
reader.Context.Config.DebugContext.LogWarning("Could not find method with name " + name + " on type '" + declaringType.GetNiceFullName() + (wasAmbiguous ? "; resolution was ambiguous between multiple methods" : string.Empty) + ".");
}
return;
}
if (methodInfo.IsGenericMethodDefinition)
{
if (genericArguments == null)
{
reader.Context.Config.DebugContext.LogWarning("Method '" + declaringType.GetNiceFullName() + "." + methodInfo.GetNiceName() + "' to deserialize is a generic method definition, but no generic arguments were in the serialization data.");
return;
}
int argCount = methodInfo.GetGenericArguments().Length;
if (genericArguments.Length != argCount)
{
reader.Context.Config.DebugContext.LogWarning("Method '" + declaringType.GetNiceFullName() + "." + methodInfo.GetNiceName() + "' to deserialize is a generic method definition, but there is the wrong number of generic arguments in the serialization data.");
return;
}
for (int i = 0; i < genericArguments.Length; i++)
{
if (genericArguments[i] == null)
{
reader.Context.Config.DebugContext.LogWarning("Method '" + declaringType.GetNiceFullName() + "." + methodInfo.GetNiceName() + "' to deserialize is a generic method definition, but one of the serialized generic argument types failed to bind on deserialization.");
return;
}
}
try
{
methodInfo = methodInfo.MakeGenericMethod(genericArguments);
}
catch (Exception ex)
{
reader.Context.Config.DebugContext.LogWarning("Method '" + declaringType.GetNiceFullName() + "." + methodInfo.GetNiceName() + "' to deserialize is a generic method definition, but failed to create generic method from definition, using generic arguments '" + string.Join(", ", genericArguments.Select(p => p.GetNiceFullName()).ToArray()) + "'. Method creation failed with an exception of type " + ex.GetType().GetNiceFullName() + ", with the message: " + ex.Message);
return;
}
}
try
{
value = (T)methodInfo;
}
catch (InvalidCastException)
{
reader.Context.Config.DebugContext.LogWarning("The serialized method '" + declaringType.GetNiceFullName() + "." + methodInfo.GetNiceName() + "' was successfully resolved into a MethodInfo reference of the runtime type '" + methodInfo.GetType().GetNiceFullName() + "', but failed to be cast to expected type '" + typeof(T).GetNiceFullName() + "'.");
return;
}
this.RegisterReferenceID(value, reader);
#endif
reader.Context.Config.DebugContext.LogWarning("MethodInfo deserialization has been removed for security."); //VRC
}
|
/// <summary>
/// Provides the actual implementation for deserializing a value of type <see cref="!:T" />.
/// </summary>
/// <param name="value">The uninitialized value to serialize into. This value will have been created earlier using <see cref="M:OdinSerializer.BaseFormatter`1.GetUninitializedObject" />.</param>
/// <param name="reader">The reader to deserialize with.</param>
|
https://github.com/MMMaellon/SmartObjectSync/blob/f600f5a5df125ac4e01d35c43ed60d0d2b3c0594/Packages/com.vrchat.worlds/Runtime/Udon/Serialization/OdinSerializer/Core/Formatters/MethodInfoFormatter.cs#L46-L227
|
f600f5a5df125ac4e01d35c43ed60d0d2b3c0594
|
SmartObjectSync
|
github_2023
|
MMMaellon
|
csharp
|
PrefabDeserializeUtility.GetSceneObjectsToKeepSet
|
public static HashSet<object> GetSceneObjectsToKeepSet(UnityEngine.Object unityObject, bool createIfDoesntExist)
{
HashSet<object> keep;
if (!SceneObjectsToKeepOnApply.TryGetValue(unityObject, out keep))
{
keep = new HashSet<object>(ReferenceEqualityComparer<object>.Default);
SceneObjectsToKeepOnApply.Add(unityObject, keep);
}
return keep;
}
|
/// <summary>
/// Note: it is assumed that code calling this is holding the DeserializePrefabCaches_LOCK lock, and will continue to hold it while the returned hashset is being modified
/// </summary>
|
https://github.com/MMMaellon/SmartObjectSync/blob/f600f5a5df125ac4e01d35c43ed60d0d2b3c0594/Packages/com.vrchat.worlds/Runtime/Udon/Serialization/OdinSerializer/Unity Integration/UnitySerializationUtility.cs#L137-L148
|
f600f5a5df125ac4e01d35c43ed60d0d2b3c0594
|
CFScanner
|
github_2023
|
MortezaBashsiz
|
csharp
|
CustomConfigInfo.isDefaultConfig
|
public bool isDefaultConfig()
{
return fileName == content && content == "Default";
}
|
// is default config?
|
https://github.com/MortezaBashsiz/CFScanner/blob/bcb96dd437e9cf90350ee5581df613b92380827f/windows/Classes/Config/CustomConfigs.cs#L115-L118
|
bcb96dd437e9cf90350ee5581df613b92380827f
|
CFScanner
|
github_2023
|
MortezaBashsiz
|
csharp
|
ScanResults.load
|
public bool load()
{
try
{
if (!File.Exists(resultsFileName))
{
return false;
}
string jsonString = File.ReadAllText(resultsFileName);
loadedInstance = JsonSerializer.Deserialize<ScanResults>(jsonString)!;
}
catch (Exception ex)
{
Tools.logStep($"ScanResults.load() had exception: {ex.Message}");
return false;
}
return true;
}
|
// load app config
|
https://github.com/MortezaBashsiz/CFScanner/blob/bcb96dd437e9cf90350ee5581df613b92380827f/windows/Classes/Config/ScanResults.cs#L45-L65
|
bcb96dd437e9cf90350ee5581df613b92380827f
|
FluentStorage
|
github_2023
|
robinrodricks
|
csharp
|
FtpFixture.InitializeAsync
|
public async Task InitializeAsync() {
await FtpContainer.StartAsync().ConfigureAwait(false);
}
|
///<inheritdoc/>
|
https://github.com/robinrodricks/FluentStorage/blob/7bac0df391a5d8df1abe19d965e2e9b476aa37e5/FluentStorage.Tests.FTP/FtpFixture.cs#L55-L57
|
7bac0df391a5d8df1abe19d965e2e9b476aa37e5
|
FluentStorage
|
github_2023
|
robinrodricks
|
csharp
|
GenericValidation.CheckBlobPrefix
|
public static void CheckBlobPrefix(string prefix) {
if (prefix == null) return;
string[] parts = prefix.Split('/');
foreach (string part in parts) {
if (part.Length > MaxBlobPrefixLength)
throw new ArgumentException(
string.Format("blob prefix cannot exceed {0} characters", MaxBlobPrefixLength),
nameof(prefix));
}
}
|
/// <summary>
/// Validates blob prefix search
/// </summary>
/// <param name="prefix"></param>
|
https://github.com/robinrodricks/FluentStorage/blob/7bac0df391a5d8df1abe19d965e2e9b476aa37e5/FluentStorage/GenericValidation.cs#L18-L29
|
7bac0df391a5d8df1abe19d965e2e9b476aa37e5
|
ThrottlingTroll
|
github_2023
|
ThrottlingTroll
|
csharp
|
ThrottlingTrollExtensions.UseThrottlingTroll
|
public static IApplicationBuilder UseThrottlingTroll(this IApplicationBuilder builder, Action<ThrottlingTrollOptions> options = null)
{
// Need to create this instance here, so that Assemblies are correctly initialized.
var opt = new ThrottlingTrollOptions
{
Assemblies = new List<Assembly> { Assembly.GetCallingAssembly() }
};
if (options != null)
{
options(opt);
}
opt.GetConfigFunc = ThrottlingTrollCoreExtensions.MergeAllConfigSources(opt.Config, CollectDeclarativeConfig(opt.Assemblies), opt.GetConfigFunc, builder.ApplicationServices);
if (opt.Log == null)
{
var logger = builder.ApplicationServices.GetService<ILogger<ThrottlingTroll>>();
opt.Log = logger == null ? null : (l, s) => logger.Log(l, s);
}
// TODO: move default counter store creation into ThrottlingTroll
opt.CounterStore ??= builder.ApplicationServices.GetService<ICounterStore>() ?? new MemoryCacheCounterStore();
return builder.UseMiddleware<ThrottlingTrollMiddleware>(opt);
}
|
/// <summary>
/// Configures ThrottlingTroll ingress throttling
/// </summary>
|
https://github.com/ThrottlingTroll/ThrottlingTroll/blob/ae518fcb7b4a24633a806f389599e68457ff05fe/ThrottlingTroll.AspNet/ThrottlingTrollExtensions.cs#L24-L49
|
ae518fcb7b4a24633a806f389599e68457ff05fe
|
ThrottlingTroll
|
github_2023
|
ThrottlingTroll
|
csharp
|
ThrottlingTrollHandlerExtensions.AddThrottlingTrollMessageHandler
|
public static IHttpClientBuilder AddThrottlingTrollMessageHandler(this IHttpClientBuilder builder, Action<ThrottlingTrollOptions> options = null)
{
return builder.AddThrottlingTrollMessageHandler(options == null ? null : (provider, opt) => options(opt));
}
|
/// <summary>
/// Appends <see cref="ThrottlingTrollHandler"/> to the given HttpClient.
/// Optionally allows to configure options.
/// </summary>
|
https://github.com/ThrottlingTroll/ThrottlingTroll/blob/ae518fcb7b4a24633a806f389599e68457ff05fe/ThrottlingTroll.Core/ThrottlingTrollHandler.cs#L533-L536
|
ae518fcb7b4a24633a806f389599e68457ff05fe
|
VRTRAKILL
|
github_2023
|
whateverusername0
|
csharp
|
HapticRack.Awake
|
void Awake()
{
if ( linearMapping == null )
{
linearMapping = GetComponent<LinearMapping>();
}
}
|
//-------------------------------------------------
|
https://github.com/whateverusername0/VRTRAKILL/blob/74dd472bf13baf273a8e2793712174050ff415be/VRTRAKILL.Plugin/New Unity Project/Assets/SteamVR/InteractionSystem/Core/Scripts/HapticRack.cs#L36-L42
|
74dd472bf13baf273a8e2793712174050ff415be
|
VRTRAKILL
|
github_2023
|
whateverusername0
|
csharp
|
LinearAnimator.Awake
|
void Awake()
{
if ( animator == null )
{
animator = GetComponent<Animator>();
}
animator.speed = 0.0f;
if ( linearMapping == null )
{
linearMapping = GetComponent<LinearMapping>();
}
}
|
//-------------------------------------------------
|
https://github.com/whateverusername0/VRTRAKILL/blob/74dd472bf13baf273a8e2793712174050ff415be/VRTRAKILL.Plugin/New Unity Project/Assets/SteamVR/InteractionSystem/Core/Scripts/LinearAnimator.cs#L23-L36
|
74dd472bf13baf273a8e2793712174050ff415be
|
VRTRAKILL
|
github_2023
|
whateverusername0
|
csharp
|
SoundPlayOneshot.Awake
|
void Awake()
{
thisAudioSource = GetComponent<AudioSource>();
if ( playOnAwake )
{
Play();
}
}
|
//-------------------------------------------------
|
https://github.com/whateverusername0/VRTRAKILL/blob/74dd472bf13baf273a8e2793712174050ff415be/VRTRAKILL.Plugin/New Unity Project/Assets/SteamVR/InteractionSystem/Core/Scripts/SoundPlayOneshot.cs#L28-L36
|
74dd472bf13baf273a8e2793712174050ff415be
|
VRTRAKILL
|
github_2023
|
whateverusername0
|
csharp
|
ArrowHand.Awake
|
void Awake()
{
allowTeleport = GetComponent<AllowTeleportWhileAttachedToHand>();
//allowTeleport.teleportAllowed = true;
allowTeleport.overrideHoverLock = false;
arrowList = new List<GameObject>();
}
|
//-------------------------------------------------
|
https://github.com/whateverusername0/VRTRAKILL/blob/74dd472bf13baf273a8e2793712174050ff415be/VRTRAKILL.Plugin/New Unity Project/Assets/SteamVR/InteractionSystem/Longbow/Scripts/ArrowHand.cs#L46-L53
|
74dd472bf13baf273a8e2793712174050ff415be
|
VRTRAKILL
|
github_2023
|
whateverusername0
|
csharp
|
PlatformerMovementP.Update
|
[HarmonyPrefix] [HarmonyPatch(nameof(PlatformerMovement.Update))] static bool Update(PlatformerMovement __instance)
{
if (MonoSingleton<OptionsManager>.Instance.paused) return false;
Vector2 vector = Vector2.zero;
if (__instance.activated)
{
vector = Input.InputVars.MoveVector * Vars.Config.MovementMultiplier;
__instance.movementDirection = Vector3.ClampMagnitude(vector.x * Vector3.right + vector.y * Vector3.forward, 1f);
__instance.movementDirection = Quaternion.Euler(0f, __instance.platformerCamera.rotation.eulerAngles.y, 0f) * __instance.movementDirection;
}
else
{
__instance.rb.velocity = new Vector3(0f, __instance.rb.velocity.y, 0f);
__instance.movementDirection = Vector3.zero;
}
if (__instance.movementDirection.magnitude > 0f) __instance.anim.SetBool("Running", true);
else __instance.anim.SetBool("Running", false);
if (__instance.rb.velocity.y < -100f)
__instance.rb.velocity = new Vector3(__instance.rb.velocity.x, -100f, __instance.rb.velocity.z);
if (__instance.activated && MonoSingleton<InputManager>.Instance.InputSource.Jump.WasPerformedThisFrame
&& !__instance.falling && !__instance.jumpCooldown) __instance.Jump(false, 1f);
if (!__instance.groundCheck.onGround)
{
if (__instance.fallTime < 1f)
{
__instance.fallTime += Time.deltaTime * 5f;
if (__instance.fallTime > 1f) __instance.falling = true;
}
else if (__instance.rb.velocity.y < -2f) __instance.fallSpeed = __instance.rb.velocity.y;
}
else __instance.fallTime = 0f;
if (__instance.groundCheck.onGround && __instance.falling && !__instance.jumpCooldown)
{
__instance.falling = false;
__instance.fallSpeed = 0f;
__instance.groundCheck.heavyFall = false;
}
if (MonoSingleton<InputManager>.Instance.InputSource.Slide.WasPerformedThisFrame && __instance.groundCheck.onGround
&& __instance.activated && !__instance.sliding) __instance.StartSlide();
RaycastHit raycastHit;
if (MonoSingleton<InputManager>.Instance.InputSource.Slide.WasPerformedThisFrame
&& !__instance.groundCheck.onGround && !__instance.sliding && !__instance.jumping && __instance.activated
&& Physics.Raycast(__instance.groundCheck.transform.position + __instance.transform.up, __instance.transform.up * -1f, out raycastHit, 2f,
LayerMaskDefaults.Get(LMD.Environment))) __instance.StartSlide();
if (MonoSingleton<InputManager>.Instance.InputSource.Slide.WasCanceledThisFrame && __instance.sliding)
__instance.StopSlide();
if (__instance.sliding && __instance.activated)
{
__instance.slideLength += Time.deltaTime;
if (__instance.currentSlideEffect != null) __instance.currentSlideEffect.transform.position = __instance.transform.position + __instance.dodgeDirection * 10f;
if (__instance.slideSafety > 0f) __instance.slideSafety -= Time.deltaTime * 5f;
if (__instance.groundCheck.onGround) __instance.currentSlideScrape.transform.position = __instance.transform.position + __instance.dodgeDirection;
else __instance.currentSlideScrape.transform.position = Vector3.one * 5000f;
}
// Dash fix
if (MonoSingleton<InputManager>.Instance.InputSource.Dodge.WasPerformedThisFrame && __instance.activated)
{
if (__instance.groundProperties && !__instance.groundProperties.canDash)
if (!__instance.groundProperties.silentDashFail) Object.Instantiate<GameObject>(__instance.staminaFailSound);
/* else */ if (__instance.boostCharge >= 100f)
{
if (__instance.sliding) __instance.StopSlide();
__instance.boostLeft = 100f;
__instance.boost = true;
__instance.anim.Play("Dash", -1, 0f);
__instance.dodgeDirection = __instance.movementDirection.normalized * Vars.Config.MovementMultiplier;
if (__instance.dodgeDirection == Vector3.zero)
__instance.dodgeDirection = __instance.playerModel.forward * Vars.Config.MovementMultiplier;
Quaternion identity = Quaternion.identity;
identity.SetLookRotation(__instance.dodgeDirection * -1f);
Object.Instantiate<GameObject>
(__instance.dodgeParticle, __instance.transform.position + Vector3.up * 2f + __instance.dodgeDirection * 10f, identity).transform.localScale *= 2f;
if (!MonoSingleton<AssistController>.Instance.majorEnabled || !MonoSingleton<AssistController>.Instance.infiniteStamina)
__instance.boostCharge -= 100f;
__instance.aud.clip = __instance.dodgeSound;
__instance.aud.volume = 1f;
__instance.aud.pitch = 1f;
__instance.aud.Play();
}
else Object.Instantiate<GameObject>(__instance.staminaFailSound);
}
if (__instance.boostCharge != 300f && !__instance.sliding && !__instance.spinning)
{
float num = 1f;
if (__instance.difficulty == 1) num = 1.5f;
else if (__instance.difficulty == 0) num = 2f;
__instance.boostCharge = Mathf.MoveTowards(__instance.boostCharge, 300f, 70f * Time.deltaTime * num);
}
if (__instance.spinCooldown > 0f) __instance.spinCooldown = Mathf.MoveTowards(__instance.spinCooldown, 0f, Time.deltaTime);
if (__instance.activated && !__instance.spinning && __instance.spinCooldown <= 0f && !MonoSingleton<InputManager>.Instance.PerformingCheatMenuCombo()
&& (MonoSingleton<InputManager>.Instance.InputSource.Fire1.WasPerformedThisFrame
|| MonoSingleton<InputManager>.Instance.InputSource.Fire2.WasPerformedThisFrame
|| MonoSingleton<InputManager>.Instance.InputSource.Punch.WasPerformedThisFrame)
&& !MonoSingleton<OptionsManager>.Instance.paused) __instance.Spin();
if (__instance.spinning) __instance.playerModel.Rotate(Vector3.up, Time.deltaTime * 3600f, Space.Self);
else if (__instance.movementDirection.magnitude != 0f || __instance.boost)
{
Quaternion quaternion = Quaternion.LookRotation(__instance.movementDirection);
if (__instance.boost)
quaternion = Quaternion.LookRotation(__instance.dodgeDirection);
__instance.playerModel.rotation =
Quaternion.RotateTowards(__instance.playerModel.rotation, quaternion,
(Quaternion.Angle(__instance.playerModel.rotation, quaternion) + 20f) * 35f * __instance.movementDirection.magnitude * Time.deltaTime);
}
if (__instance.cameraTrack)
{
if (!__instance.freeCamera)
{
__instance.CheckCameraTarget(false);
__instance.platformerCamera.transform.position =
Vector3.MoveTowards(__instance.platformerCamera.position, __instance.transform.position + __instance.cameraTarget,
Time.deltaTime * 15f * (0.1f + Vector3.Distance(__instance.platformerCamera.position, __instance.cameraTarget)));
__instance.platformerCamera.transform.rotation =
Quaternion.RotateTowards(__instance.platformerCamera.transform.rotation,
Quaternion.Euler(__instance.cameraRotation), Time.deltaTime * 15f * (0.1f + Vector3.Distance(__instance.platformerCamera.rotation.eulerAngles,
__instance.cameraRotation)));
}
else if (!MonoSingleton<OptionsManager>.Instance.paused)
{
__instance.platformerCamera.transform.position = __instance.transform.position + __instance.defaultCameraTarget;
__instance.platformerCamera.transform.rotation = Quaternion.Euler(__instance.defaultCameraRotation);
Vector2 vector2 = MonoSingleton<InputManager>.Instance.InputSource.Look.ReadValue<Vector2>();
if (!MonoSingleton<CameraController>.Instance.reverseY) __instance.rotationX += vector2.y * (MonoSingleton<OptionsManager>.Instance.mouseSensitivity / 10f);
else __instance.rotationX -= vector2.y * (MonoSingleton<OptionsManager>.Instance.mouseSensitivity / 10f);
if (!MonoSingleton<CameraController>.Instance.reverseX) __instance.rotationY += vector2.x * (MonoSingleton<OptionsManager>.Instance.mouseSensitivity / 10f);
else __instance.rotationY -= vector2.x * (MonoSingleton<OptionsManager>.Instance.mouseSensitivity / 10f);
if (__instance.rotationY > 180f) __instance.rotationY -= 360f;
else if (__instance.rotationY < -180f) __instance.rotationY += 360f;
__instance.rotationX = Mathf.Clamp(__instance.rotationX, -69f, 109f);
float num2 = 2.5f;
if (__instance.sliding || Physics.Raycast(__instance.transform.position + Vector3.up * 0.625f, Vector3.up, 2.5f, LayerMaskDefaults.Get(LMD.Environment)))
num2 = 0.625f;
Vector3 vector3 = __instance.transform.position + Vector3.up * num2;
__instance.platformerCamera.RotateAround(vector3, Vector3.left, __instance.rotationX);
__instance.platformerCamera.RotateAround(vector3, Vector3.up, __instance.rotationY);
RaycastHit raycastHit2;
if (Physics.SphereCast(vector3, 0.25f, __instance.platformerCamera.position - vector3, out raycastHit2,
Vector3.Distance(vector3, __instance.platformerCamera.position), LayerMaskDefaults.Get(LMD.Environment)))
__instance.platformerCamera.position = raycastHit2.point + 0.5f * raycastHit2.normal;
}
}
RaycastHit raycastHit3;
if (Physics.SphereCast(__instance.transform.position + Vector3.up, 0.5f, Vector3.down, out raycastHit3, float.PositiveInfinity,
LayerMaskDefaults.Get(LMD.Environment), QueryTriggerInteraction.Ignore))
{
__instance.jumpShadow.position = raycastHit3.point + Vector3.up * 0.05f;
__instance.jumpShadow.forward = raycastHit3.normal;
}
else
{
__instance.jumpShadow.position = __instance.transform.position - Vector3.up * 1000f;
__instance.jumpShadow.forward = Vector3.up;
}
if (__instance.coinTimer > 0f) __instance.coinTimer = Mathf.MoveTowards(__instance.coinTimer, 0f, Time.deltaTime);
if (__instance.coinEffectTimer > 0f) __instance.coinEffectTimer = Mathf.MoveTowards(__instance.coinEffectTimer, 0f, Time.deltaTime);
else if (__instance.queuedCoins > 0) __instance.CoinGetEffect();
if (__instance.invincible && __instance.extraHits < 3)
{
if (__instance.blinkTimer > 0f)
__instance.blinkTimer = Mathf.MoveTowards(__instance.blinkTimer, 0f, Time.deltaTime);
else
{
__instance.blinkTimer = 0.05f;
if (__instance.playerModel.gameObject.activeSelf) __instance.playerModel.gameObject.SetActive(false);
else __instance.playerModel.gameObject.SetActive(true);
}
}
if (__instance.superTimer > 0f)
{
if (!NoWeaponCooldown.NoCooldown) __instance.superTimer = Mathf.MoveTowards(__instance.superTimer, 0f, Time.deltaTime);
if (__instance.superTimer == 0f) __instance.GetHit();
}
return false;
}
|
// change movement vector to vr one
|
https://github.com/whateverusername0/VRTRAKILL/blob/74dd472bf13baf273a8e2793712174050ff415be/VRTRAKILL.Plugin/Plugin/ULTRAKILL/Movement/Patches/PlatformerMovementP.cs#L12-L218
|
74dd472bf13baf273a8e2793712174050ff415be
|
VRTRAKILL
|
github_2023
|
whateverusername0
|
csharp
|
HUDOptionsP.FlashImageTweak
|
[HarmonyPostfix] [HarmonyPatch(typeof(FlashImage), nameof(FlashImage.Flash))] static void FlashImageTweak(FlashImage __instance)
{
if (__instance.gameObject.name.Contains("White") || __instance.gameObject.name.Contains("Black"))
__instance.transform.localScale *= 20;
}
|
/// <summary>
/// Fuck you
/// </summary>
|
https://github.com/whateverusername0/VRTRAKILL/blob/74dd472bf13baf273a8e2793712174050ff415be/VRTRAKILL.Plugin/Plugin/ULTRAKILL/UI/Patches/HUDOptionsP.cs#L70-L74
|
74dd472bf13baf273a8e2793712174050ff415be
|
Bloatynosy
|
github_2023
|
builtbybel
|
csharp
|
ExperienceView.CreateRoundRectRgn
|
[System.Runtime.InteropServices.DllImport("gdi32.dll")]
private static extern IntPtr CreateRoundRectRgn(int nLeftRect, int nTopRect, int nRightRect, int nBottomRect, int nWidthEllipse, int nHeightEllipse);
|
// Import rounded corners
|
https://github.com/builtbybel/Bloatynosy/blob/48d27896be3557e1878094b86362514b8ab6cbca/src/Bloatynosy/Views/ExperienceView.cs#L137-L138
|
48d27896be3557e1878094b86362514b8ab6cbca
|
Ursa.Avalonia
|
github_2023
|
irihitech
|
csharp
|
CalendarView.OnHeaderButtonClick
|
private void OnHeaderButtonClick(object? sender, RoutedEventArgs e)
{
// Header button should be hidden in Month mode.
if (Mode == CalendarViewMode.Month) return;
if (Mode == CalendarViewMode.Year)
{
Mode = CalendarViewMode.Decade;
var range = DateTimeHelper.GetDecadeViewRangeByYear(ContextDate.Year!.Value);
_dateContextSyncing = true;
ContextDate = ContextDate.With(startYear: range.start, endYear: range.end);
_dateContextSyncing = false;
UpdateYearButtons();
return;
}
if (Mode == CalendarViewMode.Decade)
{
Mode = CalendarViewMode.Century;
var range = DateTimeHelper.GetCenturyViewRangeByYear(ContextDate.StartYear!.Value);
_dateContextSyncing = true;
ContextDate = ContextDate.With(startYear: range.start, endYear: range.end);
_dateContextSyncing = false;
UpdateYearButtons();
}
}
|
/// <summary>
/// Rule:
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
|
https://github.com/irihitech/Ursa.Avalonia/blob/ada538555472f8d623efda22a48c3d2ee7ed7e37/src/Ursa/Controls/DateTimePicker/CalendarView.cs#L246-L270
|
ada538555472f8d623efda22a48c3d2ee7ed7e37
|
UnityFigmaBridge
|
github_2023
|
simonoliver
|
csharp
|
EffectManager.ApplyAllFigmaEffectsToUnityNode
|
public static void ApplyAllFigmaEffectsToUnityNode(GameObject nodeGameObject,Node node,
FigmaImportProcessData figmaImportProcessData)
{
foreach (var effect in node.effects) ApplyEffectToUnityNode(nodeGameObject,node,effect,figmaImportProcessData);
}
|
/// <summary>
/// Apply all effects to a given node
/// </summary>
/// <param name="nodeGameObject"></param>
/// <param name="node"></param>
/// <param name="figmaImportProcessData"></param>
|
https://github.com/simonoliver/UnityFigmaBridge/blob/dbd12bff29e8bc84e2682bb19495899711651455/UnityFigmaBridge/Editor/Nodes/EffectManager.cs#L20-L25
|
dbd12bff29e8bc84e2682bb19495899711651455
|
SubmersedVR
|
github_2023
|
Okabintaro
|
csharp
|
OffsetCalibrationTool.UnparentTarget
|
public void UnparentTarget(SteamVR_Action_Boolean fromAction, SteamVR_Input_Sources fromSource)
{
parent = target.parent;
Mod.logger.LogInfo($"Unparenting {target.name}, remembering {parent.name}");
target.SetParent(null, true);
}
|
// Unparent Target, so we can finetune the position
|
https://github.com/Okabintaro/SubmersedVR/blob/726867165cc602ba929477d1f02991fd1b1ded9a/SubmersedVR/VR/OffsetCalibrationTool.cs#L58-L63
|
726867165cc602ba929477d1f02991fd1b1ded9a
|
devhome
|
github_2023
|
microsoft
|
csharp
|
CardProperty.ConvertMsResourceToIcon
|
public static unsafe BitmapImage ConvertMsResourceToIcon(Uri iconPathUri, string packageFullName)
{
try
{
var indirectPathToResource = "@{" + packageFullName + "? " + iconPathUri.AbsoluteUri + "}";
Span<char> outputBuffer = new char[MaxBufferLength];
fixed (char* outBufferPointer = outputBuffer)
{
fixed (char* resourcePathPointer = indirectPathToResource)
{
var res = PInvoke.SHLoadIndirectString(resourcePathPointer, new PWSTR(outBufferPointer), (uint)outputBuffer.Length, null);
if (res.Succeeded)
{
var iconImageLocation = new string(outputBuffer.TrimEnd('\0'));
if (File.Exists(iconImageLocation))
{
var bitmap = new BitmapImage();
bitmap.UriSource = new Uri(iconImageLocation);
return bitmap;
}
}
Log.Error($"Failed to find icon image in path: {iconPathUri} for package: {packageFullName} due to error: 0x{res.Value:X}");
}
}
}
catch (Exception ex)
{
Log.Error(ex, $"Failed to load icon from ms-resource: {iconPathUri} for package: {packageFullName} due to error:");
}
return new BitmapImage();
}
|
/// <summary>
/// Converts a passed in ms-resource URI and package full name to a BitmapImage.
/// </summary>
/// <param name="iconPathUri">the ms-resource:// path to an image resource in an app packages pri file.</param>
/// <returns>The bitmap image that represents the icon.</returns>
|
https://github.com/microsoft/devhome/blob/d52734ce0e33a82af3313d24c3c2979c37b68bab/common/Environments/Models/CardProperty.cs#L115-L149
|
d52734ce0e33a82af3313d24c3c2979c37b68bab
|
devhome
|
github_2023
|
microsoft
|
csharp
|
ExperimentalFeaturesViewModel.IsFeaturePresent
|
private bool IsFeaturePresent(ExperimentalFeature experimentalFeature)
{
if (string.Equals(experimentalFeature.Id, "FileExplorerSourceControlIntegration", StringComparison.OrdinalIgnoreCase))
{
try
{
return ExtraFolderPropertiesWrapper.IsSupported();
}
catch (Exception)
{
return false;
}
}
throw new NotImplementedException();
}
|
/// <summary>
/// Checks if the specified experimental feature is present on the machine.
/// This method should be extended to handle new features by adding the corresponding
/// feature check logic. If a feature is supported on the current machine, it should
/// return false here.
/// </summary>
|
https://github.com/microsoft/devhome/blob/d52734ce0e33a82af3313d24c3c2979c37b68bab/settings/DevHome.Settings/ViewModels/ExperimentalFeaturesViewModel.cs#L39-L54
|
d52734ce0e33a82af3313d24c3c2979c37b68bab
|
devhome
|
github_2023
|
microsoft
|
csharp
|
TelemetryFactory.Get
|
public static T Get<T>()
where T : ITelemetry
{
return (T)(object)GetTelemetryInstance();
}
|
/// <summary>
/// Gets a singleton instance of Telemetry
/// This would be useful for the future when interfaces have been updated for logger like ITelemetry2, ITelemetry3 and so on
|
https://github.com/microsoft/devhome/blob/d52734ce0e33a82af3313d24c3c2979c37b68bab/telemetry/DevHome.Telemetry/TelemetryFactory.cs#L32-L36
|
d52734ce0e33a82af3313d24c3c2979c37b68bab
|
devhome
|
github_2023
|
microsoft
|
csharp
|
TestSystems.ShutDownAsync
|
public IAsyncOperation<ComputeSystemOperationResult> ShutDownAsync(string options) => throw new NotImplementedException();
|
// Unimplemented APIs
|
https://github.com/microsoft/devhome/blob/d52734ce0e33a82af3313d24c3c2979c37b68bab/tools/Environments/DevHome.Environments/TestModels/TestSystems.cs#L123-L123
|
d52734ce0e33a82af3313d24c3c2979c37b68bab
|
devhome
|
github_2023
|
microsoft
|
csharp
|
WindowsDriverExtensions.Wait
|
public static DefaultWait<WindowsDriver<WindowsElement>> Wait(
this WindowsDriver<WindowsElement> driver,
TimeSpan timeout,
TimeSpan pollingInterval)
{
return new(driver)
{
Timeout = timeout,
PollingInterval = pollingInterval,
};
}
|
/// <summary>
/// Create an instance of <see cref="DefaultWait{T}"/>
/// </summary>
/// <param name="driver">Driver instance</param>
/// <param name="timeout">Wait timeout</param>
/// <param name="pollingInterval">Action interval</param>
/// <returns>Instance of <see cref="DefaultWait{T}"/></returns>
|
https://github.com/microsoft/devhome/blob/d52734ce0e33a82af3313d24c3c2979c37b68bab/uitest/Extensions/WindowsDriverExtensions.cs#L22-L32
|
d52734ce0e33a82af3313d24c3c2979c37b68bab
|
whisper.net
|
github_2023
|
sandrohanea
|
csharp
|
Program.Main
|
public static async Task Main(string[] args)
{
// We declare for variables which we will use later, ggmlType, modelFileName, wavFileName and coreMlModelcName
var ggmlType = GgmlType.Base;
var modelFileName = "ggml-base.bin";
var wavFileName = "kennedy.wav";
var coreMlModelcName = "ggml-base-encoder.mlmodelc";
// This section detects whether the "ggml-base.bin" file exists in our project disk. If it doesn't, it downloads it from the internet
if (!File.Exists(modelFileName))
{
await DownloadModel(modelFileName, ggmlType);
}
// This sections detects whether the modelc directory (used by CoreML) is in out project disk. If it doesn't, it downloads it and extract it to the current folder.
if (!Directory.Exists(coreMlModelcName))
{
// Note: The modelc directory needs to be extracted at the same level as the "ggml-base.bin" file (and the current executable).
await WhisperGgmlDownloader.GetEncoderCoreMLModelAsync(ggmlType)
.ExtractToPath(".");
}
// Optional logging from the native library
using var whisperLogger = LogProvider.AddLogger((level, message) =>
{
Console.Write($"{level}: {message}");
});
// This section creates the whisperFactory object which is used to create the processor object.
using var whisperFactory = WhisperFactory.FromPath(modelFileName);
// This section creates the processor object which is used to process the audio file, it uses language `auto` to detect the language of the audio file.
using var processor = whisperFactory.CreateBuilder()
.WithLanguage("auto")
.Build();
using var fileStream = File.OpenRead(wavFileName);
// This section processes the audio file and prints the results (start time, end time and text) to the console.
await foreach (var result in processor.ProcessAsync(fileStream))
{
Console.WriteLine($"{result.Start}->{result.End}: {result.Text}");
}
}
|
// This examples shows how to use Whisper.net to create a transcription from an audio file with 16Khz sample rate, using CoreML
|
https://github.com/sandrohanea/whisper.net/blob/eae8f62164799288329b48c3cafd9644c295ed24/examples/CoreML/Program.cs#L13-L57
|
eae8f62164799288329b48c3cafd9644c295ed24
|
whisper.net
|
github_2023
|
sandrohanea
|
csharp
|
Program.Main
|
public static async Task Main(string[] args)
{
// We declare three variables which we will use later, ggmlType, modelFileName and wavFileName
var ggmlType = GgmlType.LargeV3Turbo;
var modelFileName = "ggml-largev3.bin";
var wavFileName = "kennedy.wav";
using var whisperLogger = LogProvider.AddConsoleLogging(WhisperLogLevel.Debug);
// This section detects whether the "ggml-largev3.bin" file exists in our project disk. If it doesn't, it downloads it from the internet
if (!File.Exists(modelFileName))
{
await DownloadModel(modelFileName, ggmlType);
}
// This section creates the whisperFactory object which is used to create the processor object.
using var whisperFactory = WhisperFactory.FromPath(modelFileName);
// This section creates the processor object which is used to process the audio file, it uses language `auto` to detect the language of the audio file.
using var processor = whisperFactory.CreateBuilder()
.WithLanguage("auto")
.Build();
using var fileStream = File.OpenRead(wavFileName);
// This section processes the audio file and prints the results (start time, end time and text) to the console.
await foreach (var result in processor.ProcessAsync(fileStream))
{
Console.WriteLine($"{result.Start}->{result.End}: {result.Text}");
}
}
|
// This examples shows how to use Whisper.net to create a transcription from an audio file with 16Khz sample rate.
// It uses both Cuda (NVidia GPU) or CPU, and loads the first one that is available.
|
https://github.com/sandrohanea/whisper.net/blob/eae8f62164799288329b48c3cafd9644c295ed24/examples/Vulkan/Program.cs#L14-L44
|
eae8f62164799288329b48c3cafd9644c295ed24
|
iMES-Factory
|
github_2023
|
zmrid
|
csharp
|
ServerExtension.MapPath
|
public static string MapPath(this string path)
{
return MapPath(path, false);
}
|
/// <summary>
/// 返回的路径后面不带/,拼接时需要自己加上/
/// </summary>
/// <param name="path"></param>
/// <returns></returns>
|
https://github.com/zmrid/iMES-Factory/blob/d301552bd0e953882ea0b2162c0e17b36dd3a2a9/iMES.Net/iMES.Core/Extensions/ServerExtension.cs#L16-L19
|
d301552bd0e953882ea0b2162c0e17b36dd3a2a9
|
iMES-Factory
|
github_2023
|
zmrid
|
csharp
|
MailHelper.Send
|
public static void Send(string title, string content, params string[] list)
{
Console.WriteLine(AppSetting.GetSection("ModifyMember")["DateUTCField"]);
MailMessage message = new MailMessage
{
From = new MailAddress(address, name)//发送人邮箱
};
foreach (var item in list)
{
message.To.Add(item);//收件人地址
}
message.Subject = title;//发送邮件的标题
message.Body = content;//发送邮件的内容
//配置smtp服务地址
SmtpClient client = new SmtpClient
{
Host = host,
Port = port,//端口587
EnableSsl = enableSsl,
//发送人邮箱与授权密码
Credentials = new NetworkCredential(address, authPwd)
};
client.Send(message);
}
|
/// <summary>
/// 发送邮件
/// </summary>
/// <param name="title">标题</param>
/// <param name="content">内容</param>
/// <param name="list">收件人</param>
|
https://github.com/zmrid/iMES-Factory/blob/d301552bd0e953882ea0b2162c0e17b36dd3a2a9/iMES.Net/iMES.Core/Utilities/MailHelper.cs#L37-L62
|
d301552bd0e953882ea0b2162c0e17b36dd3a2a9
|
iMES-Factory
|
github_2023
|
zmrid
|
csharp
|
WorkFlowManager.AddProcese
|
public static void AddProcese<T>(T entity, bool rewrite = false,bool changeTableStatus=true) where T:class
{
string workTable = typeof(T).GetEntityTableName();
Sys_WorkFlow workFlow = DBServerProvider.DbContext.Set<Sys_WorkFlow>()
.Where(x => x.WorkTable == workTable)
.Include(x => x.Sys_WorkFlowStep)
.FirstOrDefault();
if (workFlow == null || workFlow.Sys_WorkFlowStep.Count == 0) return;
//重新生成流程
if (rewrite)
{
Rewrite(entity, workFlow,changeTableStatus);
return;
}
var userInfo = UserContext.Current.UserInfo;
Guid workFlowTable_Id = Guid.NewGuid();
Sys_WorkFlowTable workFlowTable = new Sys_WorkFlowTable()
{
WorkFlowTable_Id = workFlowTable_Id,
AuditStatus = (int)AuditStatus.审核中,
CurrentOrderId = 1,
Enable = 1,
WorkFlow_Id = workFlow.WorkFlow_Id,
WorkName = workFlow.WorkName,
WorkTable = workTable,
WorkTableKey = typeof(T).GetKeyProperty().GetValue(entity).ToString(),
WorkTableName = workFlow.WorkTableName,
CreateID = userInfo.User_Id,
CreateDate = DateTime.Now,
Creator = userInfo.UserTrueName,
Sys_WorkFlowTableStep = workFlow.Sys_WorkFlowStep.OrderBy(x => x.OrderId).Select(s => new Sys_WorkFlowTableStep()
{
Sys_WorkFlowTableStep_Id = Guid.NewGuid(),
WorkFlowTable_Id = workFlowTable_Id,
WorkFlow_Id = s.WorkFlow_Id,
StepId = s.StepId,
StepName = s.StepName,
AuditId = s.StepType == (int)AuditType.用户审批 ? s.StepValue : null,
StepType = s.StepType,
StepValue = s.StepValue,
OrderId = s.OrderId,
Enable = 1,
CreateDate = DateTime.Now,
}).ToList()
};
DBServerProvider.DbContext.Set<Sys_WorkFlowTable>().Add(workFlowTable);
DBServerProvider.DbContext.SaveChanges();
}
|
/// <summary>
/// 写入流程
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="entity"></param>
/// <param name="rewrite">是否重新生成流程</param>
/// <param name="changeTableStatus">是否修改原表的审批状态</param>
|
https://github.com/zmrid/iMES-Factory/blob/d301552bd0e953882ea0b2162c0e17b36dd3a2a9/iMES.Net/iMES.Core/WorkFlow/WorkFlowManager.cs#L106-L156
|
d301552bd0e953882ea0b2162c0e17b36dd3a2a9
|
shesha-framework
|
github_2023
|
shesha-io
|
csharp
|
FilterCriteria.AppendCriteria
|
public void AppendCriteria([NotNull]FilterCriteria criteria)
{
if (criteria.FilteringMethod != this.FilteringMethod)
throw new Exception("The filtering method used is incompatible and may cause problems due to differences in syntax.");
FilterClauses.AddRange(criteria.FilterClauses);
foreach (var param in criteria.FilterParameters)
{
FilterParameters.Add(param.Key, param.Value);
}
}
|
/// <summary>
/// Copies all the <paramref name="criteria"/>'s FilterClauses and FilterParameters to this
/// FilterCriteria.
/// </summary>
/// <param name="criteria"></param>
|
https://github.com/shesha-io/shesha-framework/blob/bb69efce02d772f166ce621f6993a795f94c35df/shesha-core/src/Shesha.Framework/Domain/FilterCriteria.cs#L37-L48
|
bb69efce02d772f166ce621f6993a795f94c35df
|
shesha-framework
|
github_2023
|
shesha-io
|
csharp
|
SwaggerOperationFilter.GetSingleAttributeOfMemberOrDeclaringTypeOrDefault
|
public static TAttribute GetSingleAttributeOfMemberOrDeclaringTypeOrDefault<TAttribute>(MemberInfo memberInfo, TAttribute defaultValue = default, bool inherit = true)
where TAttribute : class
{
return memberInfo.GetCustomAttributes(true).OfType<TAttribute>().FirstOrDefault()
?? memberInfo.ReflectedType?.GetTypeInfo().GetCustomAttributes(true).OfType<TAttribute>().FirstOrDefault()
?? defaultValue;
}
|
/// <summary>
/// Copied from ABP
/// Tries to gets an of attribute defined for a class member and it's declaring type including inherited attributes.
/// Returns default value if it's not declared at all.
/// </summary>
/// <typeparam name="TAttribute">Type of the attribute</typeparam>
/// <param name="memberInfo">MemberInfo</param>
/// <param name="defaultValue">Default value (null as default)</param>
/// <param name="inherit">Inherit attribute from base classes</param>
|
https://github.com/shesha-io/shesha-framework/blob/bb69efce02d772f166ce621f6993a795f94c35df/shesha-core/src/Shesha.Framework/Swagger/SwaggerOperationFilter.cs#L144-L150
|
bb69efce02d772f166ce621f6993a795f94c35df
|
shesha-framework
|
github_2023
|
shesha-io
|
csharp
|
CodeNamingHelper.ValidateCodeIdentifier
|
public static void ValidateCodeIdentifier(string identifier)
{
if (!CSharpSyntaxHelper.IsValidIdentifier(identifier))
throw new IdentifierIsNotValidException(identifier);
}
|
/// <summary>
/// Validate specified <paramref name="identifier"/>, throws <see cref="IdentifierIsNotValidException"/> if identifier is not valid
/// </summary>
/// <param name="identifier"></param>
/// <exception cref="IdentifierIsNotValidException"></exception>
|
https://github.com/shesha-io/shesha-framework/blob/bb69efce02d772f166ce621f6993a795f94c35df/shesha-core/src/Shesha.Framework/Utilities/CodeNamingHelper.cs#L25-L29
|
bb69efce02d772f166ce621f6993a795f94c35df
|
shesha-framework
|
github_2023
|
shesha-io
|
csharp
|
ModuleLocator.GetModuleName
|
public string GetModuleName(Type migrationType)
{
return migrationType.GetConfigurableModuleName();
}
|
/// inheritedDoc
|
https://github.com/shesha-io/shesha-framework/blob/bb69efce02d772f166ce621f6993a795f94c35df/shesha-core/src/Shesha.NHibernate/NHibernate/ModuleLocator.cs#L14-L17
|
bb69efce02d772f166ce621f6993a795f94c35df
|
shesha-framework
|
github_2023
|
shesha-io
|
csharp
|
M20230516104216.Up
|
public override void Up()
{
Create.Table("SheshaFunctionalTests_Books")
.WithIdAsGuid()
.WithFullAuditColumns()
.WithColumn("Frwk_Discriminator").AsString(SheshaDatabaseConsts.DiscriminatorMaxSize).NotNullable()
.WithColumn("Name").AsString().Nullable()
.WithColumn("Description").AsString().Nullable()
.WithColumn("Price").AsDecimal();
Create.Table("SheshaFunctionalTests_Schools")
.WithIdAsGuid()
.WithFullAuditColumns()
.WithColumn("Frwk_Discriminator").AsString(SheshaDatabaseConsts.DiscriminatorMaxSize).NotNullable()
.WithColumn("Name").AsString().Nullable()
.WithColumn("Latitude").AsDecimal().Nullable()
.WithColumn("Longitude").AsDecimal()
.WithColumn("ContactNumber").AsString().Nullable();
Create.Table("SheshaFunctionalTests_Subjects")
.WithIdAsGuid()
.WithFullAuditColumns()
.WithColumn("Frwk_Discriminator").AsString(SheshaDatabaseConsts.DiscriminatorMaxSize).NotNullable()
.WithColumn("Name").AsString().Nullable()
.WithColumn("Description").AsString().Nullable()
.WithColumn("Total").AsDecimal().Nullable();
Alter.Table("SheshaFunctionalTests_Schools").AddForeignKeyColumn("AddressId", "Core_Addresses").Nullable();
Alter.Table("SheshaFunctionalTests_Schools").AddForeignKeyColumn("HeadLeaderId", "Core_Persons").Nullable();
Alter.Table("SheshaFunctionalTests_Subjects").AddForeignKeyColumn("BookId", "SheshaFunctionalTests_Books").Nullable();
Alter.Table("SheshaFunctionalTests_Subjects").AddForeignKeyColumn("SchoolId", "SheshaFunctionalTests_Schools").Nullable();
}
|
/// <summary>
///
/// </summary>
|
https://github.com/shesha-io/shesha-framework/blob/bb69efce02d772f166ce621f6993a795f94c35df/shesha-functional-tests/backend/src/Module/Boxfusion.SheshaFunctionalTests.Common.Domain/Migrations/M20230516104216.cs#L14-L53
|
bb69efce02d772f166ce621f6993a795f94c35df
|
shesha-framework
|
github_2023
|
shesha-io
|
csharp
|
M20240219144300.Up
|
public override void Up()
{
Alter.Table("SheshaFunctionalTests_MembershipPayments").AddColumn("PaymentTypeLkp").AsInt64().Nullable();
}
|
/// <summary>
///
/// </summary>
|
https://github.com/shesha-io/shesha-framework/blob/bb69efce02d772f166ce621f6993a795f94c35df/shesha-functional-tests/backend/src/Module/Boxfusion.SheshaFunctionalTests.Common.Domain/Migrations/M20240219144300.cs#L14-L17
|
bb69efce02d772f166ce621f6993a795f94c35df
|
g-helper
|
github_2023
|
seerge
|
csharp
|
AppConfig.SwappedBrightness
|
public static bool SwappedBrightness()
{
return ContainsModel("FA506IEB") || ContainsModel("FA506IH") || ContainsModel("FA506IC") || ContainsModel("FX506LU") || ContainsModel("FX506IC") || ContainsModel("FX506LH") || ContainsModel("FA506IV") || ContainsModel("FA706IC") || ContainsModel("FA706IH");
}
|
// Devices with bugged bios command to change brightness
|
https://github.com/seerge/g-helper/blob/b5428ff2e8485e95a9ac29541dcb961337bd663c/app/AppConfig.cs#L408-L411
|
b5428ff2e8485e95a9ac29541dcb961337bd663c
|
GDTask
|
github_2023
|
Fractural
|
csharp
|
GDTaskPlayerLoopAutoload.LocalAddContinuation
|
public void LocalAddContinuation(PlayerLoopTiming timing, Action continuation)
{
var q = yielders[(int)timing];
if (q == null)
{
ThrowInvalidLoopTiming(timing);
}
q.Enqueue(continuation);
}
|
// NOTE: Continuation means a asynchronous task invoked by another task after the other task finishes.
|
https://github.com/Fractural/GDTask/blob/661244bba9839c8633d2106457ef5be2faa228df/addons/GDTask/Autoload/GDTaskPlayerLoopAutoload.cs#L48-L56
|
661244bba9839c8633d2106457ef5be2faa228df
|
minishop-composer
|
github_2023
|
nichealpham
|
csharp
|
EventFlags.MatchesWeekOfMonth
|
public static bool MatchesWeekOfMonth(this DateTime date, int recurrence)
=> Matches(recurrence, 1 << (date.Day / 8));
|
// since day is [1,31], becomes [0,30]
|
https://github.com/nichealpham/minishop-composer/blob/68d2f4e875a2bd9d7c3c2c9226795d25c239ecd0/api/AppGlobal/Commons/Helpers.cs
|
68d2f4e875a2bd9d7c3c2c9226795d25c239ecd0
|
DNSveil
|
github_2023
|
msasanmh
|
csharp
|
NetworkTool.IpToHostAsync
|
public static async Task<(string Host, string BaseHost)> IpToHostAsync(string ip)
{
string result = string.Empty;
string baseHost = string.Empty;
if (!OperatingSystem.IsWindows()) return (result, baseHost);
if (!await IsInternetAliveByNicAsync()) return (result, baseHost); // nslookup takes time when there is no internet access
string content = await ProcessManager.ExecuteAsync("nslookup", null, ip, true, true);
if (string.IsNullOrEmpty(content)) return (result, baseHost);
content = content.ToLower();
string[] split = content.Split(Environment.NewLine);
for (int n = 0; n < split.Length; n++)
{
string line = split[n];
if (line.Contains("name:"))
{
result = line.Replace("name:", string.Empty).Trim();
if (result.Contains('.'))
{
GetHostDetails(result, 0, out _, out _, out baseHost, out _, out _, out _);
}
break;
}
}
return (result, baseHost);
}
|
/// <summary>
/// IP to Host using Nslookup (Windows Only)
/// </summary>
/// <param name="ip"></param>
/// <returns></returns>
|
https://github.com/msasanmh/DNSveil/blob/3f107516dddb1f4eba472665b925994f06a29162/MsmhToolsClass/MsmhToolsClass/NetworkTool.cs#L79-L105
|
3f107516dddb1f4eba472665b925994f06a29162
|
DNSveil
|
github_2023
|
msasanmh
|
csharp
|
WebAPI.Github_Latest_Release_Async
|
public static async Task<List<string>> Github_Latest_Release_Async(string owner, string repo, int timeoutMs = 5000)
{
List<string> relaeseURLs = new();
try
{
Uri apiMain = new($"https://api.github.com/repos/{owner}/{repo}/releases/latest");
HttpRequest hr = new()
{
Method = HttpMethod.Get,
AllowInsecure = true,
TimeoutMS = timeoutMs,
URI = apiMain,
Headers =
{
{ "accept", "application/json" }
}
};
HttpRequestResponse hrr = await HttpRequest.SendAsync(hr).ConfigureAwait(false);
string json = Encoding.UTF8.GetString(hrr.Data);
List<JsonTool.JsonPath> path = new()
{
new JsonTool.JsonPath() {Key = "assets", Count = 1, Conditions = new()},
new JsonTool.JsonPath() {Key = "browser_download_url", Conditions = new()}
};
relaeseURLs = JsonTool.GetValues(json, path);
}
catch (Exception ex)
{
Debug.WriteLine("WebAPI Github_Latest_Release_Async: " + ex.Message);
}
return relaeseURLs;
}
|
/// <summary>
/// Github Latest Release
/// </summary>
/// <returns>Returns Download Links</returns>
|
https://github.com/msasanmh/DNSveil/blob/3f107516dddb1f4eba472665b925994f06a29162/MsmhToolsClass/MsmhToolsClass/WebAPI.cs#L37-L72
|
3f107516dddb1f4eba472665b925994f06a29162
|
toon-rp
|
github_2023
|
Delt06
|
csharp
|
ToonMeshUtility.IntersectRayMesh
|
public static bool IntersectRayMesh(Ray ray, Mesh mesh, Matrix4x4 matrix, out RaycastHit hit)
{
object[] parameters = { ray, mesh, matrix, null };
bool result = (bool) MethodIntersectRayMesh.Invoke(null, parameters);
hit = (RaycastHit) parameters[3];
return result;
}
|
// Adapted from https://gist.github.com/MattRix/9205bc62d558fef98045
|
https://github.com/Delt06/toon-rp/blob/687b7b26747a8bd6b0905299e5248bbca0285a77/Packages/com.deltation.toon-rp/Editor/VertexColorPaint/ToonMeshUtility.cs#L82-L88
|
687b7b26747a8bd6b0905299e5248bbca0285a77
|
Avalonia.Labs
|
github_2023
|
AvaloniaUI
|
csharp
|
Application.Main
|
static void Main(string[] args)
{
// if you want to use a different Application Delegate class from "AppDelegate"
// you can specify it here.
UIApplication.Main(args, null, typeof(AppDelegate));
}
|
// This is the main entry point of the application.
|
https://github.com/AvaloniaUI/Avalonia.Labs/blob/81ee313436d2305f7c169e0a099fe84d33d50624/samples/Avalonia.Labs.Catalog.iOS/Main.cs#L8-L13
|
81ee313436d2305f7c169e0a099fe84d33d50624
|
Avalonia.Labs
|
github_2023
|
AvaloniaUI
|
csharp
|
ContentDialog.ShowAsync
|
public async Task<ContentDialogResult> ShowAsync() => await ShowAsyncCore(null);
|
/// <summary>
/// Begins an asynchronous operation to show the dialog.
/// </summary>
|
https://github.com/AvaloniaUI/Avalonia.Labs/blob/81ee313436d2305f7c169e0a099fe84d33d50624/src/Avalonia.Labs.Controls/ContentDialog/ContentDialog.cs#L113-L113
|
81ee313436d2305f7c169e0a099fe84d33d50624
|
Avalonia.Labs
|
github_2023
|
AvaloniaUI
|
csharp
|
ReedSolomonEncoder.Encode
|
internal static byte[] Encode(byte[] dataBytes, int numECBytes, GeneratorPolynomial generatorPoly)
{
int dataLength = dataBytes.Length;
if (generatorPoly == null)
throw new ArgumentNullException(nameof(generatorPoly));
if (dataLength == 0)
{
throw new ArgumentException("There is no data bytes to encode.");
}
if (numECBytes <= 0)
{
throw new ArgumentException("No Error Correction bytes.");
}
int[] toEncode = ConvertToIntArray(dataBytes, dataLength, numECBytes);
Polynomial generator = generatorPoly.GetGenerator(numECBytes);
Polynomial dataPoly = new(generator.GField, toEncode);
PolyDivideStruct divideResult = dataPoly.Divide(generator);
int[] remainderCoeffs = divideResult.Remainder.Coefficients;
return ConvertTosByteArray(remainderCoeffs, numECBytes);
}
|
/// <summary>
/// Encode an array of data codeword with GaloisField 256.
/// </summary>
/// <param name="dataBytes">Array of data codewords for a single block.</param>
/// <param name="numECBytes">Number of error correction codewords for data codewords</param>
/// <param name="generatorPoly">Cached or newly create GeneratorPolynomial</param>
/// <returns>Return error correction codewords array</returns>
|
https://github.com/AvaloniaUI/Avalonia.Labs/blob/81ee313436d2305f7c169e0a099fe84d33d50624/src/Avalonia.Labs.Qr/Encoding/ReedSolomon/ReedSolomonEncoder.cs#L14-L41
|
81ee313436d2305f7c169e0a099fe84d33d50624
|
com.doji.genesis
|
github_2023
|
julienkay
|
csharp
|
UrlUtility.AppendQuerytoUrl
|
public static void AppendQuerytoUrl(ref string url, string parameterName, string query) {
if (query == null) {
return;
}
url += parameterName + "=" + query + "&";
}
|
/// <summary>
/// Appends <paramref name="appendix"/> to <paramref name="url"/>.
/// </summary>
|
https://github.com/julienkay/com.doji.genesis/blob/696728293c8ccf78eb5114f58dfcac2516ce1c70/Packages/com.doji.genesis/Runtime/Scripts/Utils/UrlUtility.cs#L11-L16
|
696728293c8ccf78eb5114f58dfcac2516ce1c70
|
semantic-kernel
|
github_2023
|
microsoft
|
csharp
|
OpenAIAssistant_Streaming.InvokeAgentAsync
|
private async Task InvokeAgentAsync(OpenAIAssistantAgent agent, string threadId, string input)
{
ChatMessageContent message = new(AuthorRole.User, input);
await agent.AddChatMessageAsync(threadId, message);
this.WriteAgentChatMessage(message);
ChatHistory history = [];
bool isFirst = false;
bool isCode = false;
await foreach (StreamingChatMessageContent response in agent.InvokeStreamingAsync(threadId, messages: history))
{
if (string.IsNullOrEmpty(response.Content))
{
StreamingFunctionCallUpdateContent? functionCall = response.Items.OfType<StreamingFunctionCallUpdateContent>().SingleOrDefault();
if (functionCall != null)
{
Console.WriteLine($"\n# {response.Role} - {response.AuthorName ?? "*"}: FUNCTION CALL - {functionCall.Name}");
}
continue;
}
// Differentiate between assistant and tool messages
if (isCode != (response.Metadata?.ContainsKey(OpenAIAssistantAgent.CodeInterpreterMetadataKey) ?? false))
{
isFirst = false;
isCode = !isCode;
}
if (!isFirst)
{
Console.WriteLine($"\n# {response.Role} - {response.AuthorName ?? "*"}:");
isFirst = true;
}
Console.WriteLine($"\t > streamed: '{response.Content}'");
}
foreach (ChatMessageContent content in history)
{
this.WriteAgentChatMessage(content);
}
}
|
// Local function to invoke agent and display the conversation messages.
|
https://github.com/microsoft/semantic-kernel/blob/cd84e877980187e62d86bb5bc6086d264e62ee83/dotnet/samples/Concepts/Agents/OpenAIAssistant_Streaming.cs#L109-L152
|
cd84e877980187e62d86bb5bc6086d264e62ee83
|
semantic-kernel
|
github_2023
|
microsoft
|
csharp
|
ChatHistoryExtensions.GetSystemMessage
|
internal static ChatMessageContent? GetSystemMessage(this IReadOnlyList<ChatMessageContent> chatHistory)
{
return chatHistory.FirstOrDefault(m => m.Role == AuthorRole.System);
}
|
/// <summary>
/// Returns the system prompt from the chat history.
/// </summary>
/// <remarks>
/// For simplicity only a single system message is supported in these examples.
/// </remarks>
|
https://github.com/microsoft/semantic-kernel/blob/cd84e877980187e62d86bb5bc6086d264e62ee83/dotnet/samples/Concepts/ChatCompletion/ChatHistoryReducers/ChatHistoryExtensions.cs#L22-L25
|
cd84e877980187e62d86bb5bc6086d264e62ee83
|
semantic-kernel
|
github_2023
|
microsoft
|
csharp
|
AutoFunctionInvocationFiltering.AutoFunctionInvocationFilterAsync
|
[Fact]
public async Task AutoFunctionInvocationFilterAsync()
{
var builder = Kernel.CreateBuilder();
builder.AddOpenAIChatCompletion("gpt-4", TestConfiguration.OpenAI.ApiKey);
// This filter outputs information about auto function invocation and returns overridden result.
builder.Services.AddSingleton<IAutoFunctionInvocationFilter>(new AutoFunctionInvocationFilter(this.Output));
var kernel = builder.Build();
var function = KernelFunctionFactory.CreateFromMethod(() => "Result from function", "MyFunction");
kernel.ImportPluginFromFunctions("MyPlugin", [function]);
var executionSettings = new OpenAIPromptExecutionSettings
{
FunctionChoiceBehavior = FunctionChoiceBehavior.Required([function], autoInvoke: true)
};
var result = await kernel.InvokePromptAsync("Invoke provided function and return result", new(executionSettings));
Console.WriteLine(result);
// Output:
// Request sequence number: 0
// Function sequence number: 0
// Total number of functions: 1
// Result from auto function invocation filter.
}
|
/// <summary>
/// Shows how to use <see cref="IAutoFunctionInvocationFilter"/>.
/// </summary>
|
https://github.com/microsoft/semantic-kernel/blob/cd84e877980187e62d86bb5bc6086d264e62ee83/dotnet/samples/Concepts/Filtering/AutoFunctionInvocationFiltering.cs#L14-L44
|
cd84e877980187e62d86bb5bc6086d264e62ee83
|
semantic-kernel
|
github_2023
|
microsoft
|
csharp
|
MethodFunctions_Advanced.MethodFunctionsChainingAsync
|
[Fact]
public async Task MethodFunctionsChainingAsync()
{
Console.WriteLine("Running Method Function Chaining example...");
var kernel = new Kernel();
var functions = kernel.ImportPluginFromType<FunctionsChainingPlugin>();
var customType = await kernel.InvokeAsync<MyCustomType>(functions["Function1"]);
Console.WriteLine($"CustomType.Number: {customType!.Number}"); // 2
Console.WriteLine($"CustomType.Text: {customType.Text}"); // From Function1 + From Function2
}
|
/// <summary>
/// This example executes Function1, which in turn executes Function2.
/// </summary>
|
https://github.com/microsoft/semantic-kernel/blob/cd84e877980187e62d86bb5bc6086d264e62ee83/dotnet/samples/Concepts/Functions/MethodFunctions_Advanced.cs#L18-L31
|
cd84e877980187e62d86bb5bc6086d264e62ee83
|
semantic-kernel
|
github_2023
|
microsoft
|
csharp
|
VectorStore_VectorSearch_MultiVector.CreateProductRecords
|
private static IEnumerable<Product> CreateProductRecords()
{
yield return new Product
{
Key = 1,
Description = "Premium coffee maker that allows you to make up to 20 types of drinks with one machine.",
FeatureList = ["Milk Frother", "Easy to use", "One button operation", "Stylish design"]
};
yield return new Product
{
Key = 2,
Description = "Value coffee maker that gives you what you need at a good price.",
FeatureList = ["Simple design", "Easy to clean"]
};
yield return new Product
{
Key = 3,
Description = "Efficient vacuum cleaner",
FeatureList = ["1000W power", "Hard floor tool", "Bagless", "Corded"]
};
yield return new Product
{
Key = 4,
Description = "High performance handheld vacuum cleaner",
FeatureList = ["Pet hair tool", "2000W power", "Hard floor tool", "Bagless", "Cordless"]
};
}
|
/// <summary>
/// Create some sample product records.
/// </summary>
/// <returns>A list of sample product records.</returns>
|
https://github.com/microsoft/semantic-kernel/blob/cd84e877980187e62d86bb5bc6086d264e62ee83/dotnet/samples/Concepts/Memory/VectorStore_VectorSearch_MultiVector.cs#L92-L121
|
cd84e877980187e62d86bb5bc6086d264e62ee83
|
semantic-kernel
|
github_2023
|
microsoft
|
csharp
|
LegacyMenuPlugin.GetSpecials
|
[KernelFunction, Description("Provides a list of specials from the menu.")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1024:Use properties where appropriate", Justification = "Too smart")]
public string[] GetSpecials(KernelArguments? arguments)
{
return
[
"Special Soup: Clam Chowder",
"Special Salad: Cobb Salad",
"Special Drink: Chai Tea",
];
}
|
/// <summary>
/// Returns a mock item menu.
/// </summary>
|
https://github.com/microsoft/semantic-kernel/blob/cd84e877980187e62d86bb5bc6086d264e62ee83/dotnet/samples/Concepts/Resources/Plugins/LegacyMenuPlugin.cs#L13-L23
|
cd84e877980187e62d86bb5bc6086d264e62ee83
|
semantic-kernel
|
github_2023
|
microsoft
|
csharp
|
Step7_Observability.ObservabilityWithFiltersAsync
|
[Fact]
public async Task ObservabilityWithFiltersAsync()
{
// Create a kernel with OpenAI chat completion
IKernelBuilder kernelBuilder = Kernel.CreateBuilder();
kernelBuilder.AddOpenAIChatCompletion(
modelId: TestConfiguration.OpenAI.ChatModelId,
apiKey: TestConfiguration.OpenAI.ApiKey);
kernelBuilder.Plugins.AddFromType<TimeInformation>();
// Add filter using DI
kernelBuilder.Services.AddSingleton<ITestOutputHelper>(this.Output);
kernelBuilder.Services.AddSingleton<IFunctionInvocationFilter, MyFunctionFilter>();
Kernel kernel = kernelBuilder.Build();
// Add filter without DI
kernel.PromptRenderFilters.Add(new MyPromptFilter(this.Output));
// Invoke the kernel with a prompt and allow the AI to automatically invoke functions
OpenAIPromptExecutionSettings settings = new() { FunctionChoiceBehavior = FunctionChoiceBehavior.Auto() };
Console.WriteLine(await kernel.InvokePromptAsync("How many days until Christmas? Explain your thinking.", new(settings)));
}
|
/// <summary>
/// Shows how to observe the execution of a <see cref="KernelPlugin"/> instance with filters.
/// </summary>
|
https://github.com/microsoft/semantic-kernel/blob/cd84e877980187e62d86bb5bc6086d264e62ee83/dotnet/samples/GettingStarted/Step7_Observability.cs#L15-L38
|
cd84e877980187e62d86bb5bc6086d264e62ee83
|
semantic-kernel
|
github_2023
|
microsoft
|
csharp
|
LearnBaseTest.ReadLine
|
public string? ReadLine()
{
if (SimulatedInputTextIndex < SimulatedInputText.Count)
{
return SimulatedInputText[SimulatedInputTextIndex++];
}
return null;
}
|
/// <summary>
/// Simulates reading input strings from a user for the purpose of running tests.
/// </summary>
/// <returns>A simulate user input string, if available. Null otherwise.</returns>
|
https://github.com/microsoft/semantic-kernel/blob/cd84e877980187e62d86bb5bc6086d264e62ee83/dotnet/samples/LearnResources/MicrosoftLearn/LearnBaseTest.cs#L23-L31
|
cd84e877980187e62d86bb5bc6086d264e62ee83
|
semantic-kernel
|
github_2023
|
microsoft
|
csharp
|
OpenAIAssistantChannel.ReceiveAsync
|
protected override async Task ReceiveAsync(IEnumerable<ChatMessageContent> history, CancellationToken cancellationToken)
{
foreach (ChatMessageContent message in history)
{
await AssistantThreadActions.CreateMessageAsync(this._client, this._threadId, message, cancellationToken).ConfigureAwait(false);
}
}
|
/// <inheritdoc/>
|
https://github.com/microsoft/semantic-kernel/blob/cd84e877980187e62d86bb5bc6086d264e62ee83/dotnet/src/Agents/OpenAI/OpenAIAssistantChannel.cs#L20-L26
|
cd84e877980187e62d86bb5bc6086d264e62ee83
|
semantic-kernel
|
github_2023
|
microsoft
|
csharp
|
OpenAIAssistantAgentLogMessages.LogOpenAIAssistantAgentCreatingChannel
|
[LoggerMessage(
EventId = 0,
Level = LogLevel.Debug,
Message = "[{MethodName}] Creating assistant thread for {ChannelType}.")]
public static partial void LogOpenAIAssistantAgentCreatingChannel(
this ILogger logger,
string methodName,
string channelType);
|
/// <summary>
/// Logs <see cref="OpenAIAssistantAgent"/> creating channel (started).
/// </summary>
|
https://github.com/microsoft/semantic-kernel/blob/cd84e877980187e62d86bb5bc6086d264e62ee83/dotnet/src/Agents/OpenAI/Logging/OpenAIAssistantAgentLogMessages.cs#L22-L29
|
cd84e877980187e62d86bb5bc6086d264e62ee83
|
semantic-kernel
|
github_2023
|
microsoft
|
csharp
|
AssistantMessageFactoryTests.VerifyAssistantMessageAdapterCreateOptionsDefault
|
[Fact]
public void VerifyAssistantMessageAdapterCreateOptionsDefault()
{
// Arrange (Setup message with null metadata)
ChatMessageContent message = new(AuthorRole.User, "test");
// Act: Create options
MessageCreationOptions options = AssistantMessageFactory.CreateOptions(message);
// Assert
Assert.NotNull(options);
Assert.Empty(options.Metadata);
}
|
/// <summary>
/// Verify options creation.
/// </summary>
|
https://github.com/microsoft/semantic-kernel/blob/cd84e877980187e62d86bb5bc6086d264e62ee83/dotnet/src/Agents/UnitTests/OpenAI/Internal/AssistantMessageFactoryTests.cs#L21-L33
|
cd84e877980187e62d86bb5bc6086d264e62ee83
|
semantic-kernel
|
github_2023
|
microsoft
|
csharp
|
HuggingFaceServiceCollectionExtensions.AddHuggingFaceTextGeneration
|
public static IServiceCollection AddHuggingFaceTextGeneration(
this IServiceCollection services,
string model,
Uri? endpoint = null,
string? apiKey = null,
string? serviceId = null,
HttpClient? httpClient = null)
{
Verify.NotNull(services);
return services.AddKeyedSingleton<ITextGenerationService>(serviceId, (serviceProvider, _) =>
new HuggingFaceTextGenerationService(
model,
endpoint,
apiKey,
HttpClientProvider.GetHttpClient(httpClient, serviceProvider),
serviceProvider.GetService<ILoggerFactory>()));
}
|
/// <summary>
/// Adds an Hugging Face text generation service with the specified configuration.
/// </summary>
/// <param name="services">The <see cref="IServiceCollection"/> instance to augment.</param>
/// <param name="model">The name of the Hugging Face model.</param>
/// <param name="endpoint">The endpoint URL for the text generation service.</param>
/// <param name="apiKey">The API key required for accessing the Hugging Face service.</param>
/// <param name="serviceId">A local identifier for the given AI service.</param>
/// <param name="httpClient">The HttpClient to use with this service.</param>
/// <returns>The same instance as <paramref name="services"/>.</returns>
|
https://github.com/microsoft/semantic-kernel/blob/cd84e877980187e62d86bb5bc6086d264e62ee83/dotnet/src/Connectors/Connectors.HuggingFace/HuggingFaceServiceCollectionExtensions.cs#L31-L48
|
cd84e877980187e62d86bb5bc6086d264e62ee83
|
semantic-kernel
|
github_2023
|
microsoft
|
csharp
|
PineconeServiceCollectionExtensions.AddPineconeVectorStore
|
public static IServiceCollection AddPineconeVectorStore(this IServiceCollection services, PineconeVectorStoreOptions? options = default, string? serviceId = default)
{
// If we are not constructing the PineconeClient, add the IVectorStore as transient, since we
// cannot make assumptions about how PineconeClient is being managed.
services.AddKeyedTransient<IVectorStore>(
serviceId,
(sp, obj) =>
{
var pineconeClient = sp.GetRequiredService<Sdk.PineconeClient>();
var selectedOptions = options ?? sp.GetService<PineconeVectorStoreOptions>();
return new PineconeVectorStore(
pineconeClient,
selectedOptions);
});
return services;
}
|
/// <summary>
/// Register a Pinecone <see cref="IVectorStore"/> with the specified service ID and where <see cref="Sdk.PineconeClient"/> is retrieved from the dependency injection container.
/// </summary>
/// <param name="services">The <see cref="IServiceCollection"/> to register the <see cref="IVectorStore"/> on.</param>
/// <param name="options">Optional options to further configure the <see cref="IVectorStore"/>.</param>
/// <param name="serviceId">An optional service id to use as the service key.</param>
/// <returns>The service collection.</returns>
|
https://github.com/microsoft/semantic-kernel/blob/cd84e877980187e62d86bb5bc6086d264e62ee83/dotnet/src/Connectors/Connectors.Memory.Pinecone/PineconeServiceCollectionExtensions.cs#L22-L39
|
cd84e877980187e62d86bb5bc6086d264e62ee83
|
semantic-kernel
|
github_2023
|
microsoft
|
csharp
|
PostgresVectorStoreUtils.WrapAsyncEnumerableAsync
|
public static async IAsyncEnumerable<T> WrapAsyncEnumerableAsync<T>(IAsyncEnumerable<T> asyncEnumerable, string operationName, string? collectionName = null)
{
var enumerator = asyncEnumerable.ConfigureAwait(false).GetAsyncEnumerator();
var nextResult = await GetNextAsync<T>(enumerator, operationName, collectionName).ConfigureAwait(false);
while (nextResult.more)
{
yield return nextResult.item;
nextResult = await GetNextAsync(enumerator, operationName, collectionName).ConfigureAwait(false);
}
}
|
/// <summary>
/// Wraps an <see cref="IAsyncEnumerable{T}"/> in an <see cref="IAsyncEnumerable{T}"/> that will throw a <see cref="VectorStoreOperationException"/>
/// if an exception is thrown while iterating over the original enumerator.
/// </summary>
/// <typeparam name="T">The type of the items in the async enumerable.</typeparam>
/// <param name="asyncEnumerable">The async enumerable to wrap.</param>
/// <param name="operationName">The name of the operation being performed.</param>
/// <param name="collectionName">The name of the collection being operated on.</param>
/// <returns>An async enumerable that will throw a <see cref="VectorStoreOperationException"/> if an exception is thrown while iterating over the original enumerator.</returns>
|
https://github.com/microsoft/semantic-kernel/blob/cd84e877980187e62d86bb5bc6086d264e62ee83/dotnet/src/Connectors/Connectors.Memory.Postgres/PostgresVectorStoreUtils.cs#L22-L32
|
cd84e877980187e62d86bb5bc6086d264e62ee83
|
semantic-kernel
|
github_2023
|
microsoft
|
csharp
|
WeaviateVectorStoreCollectionCreateMapping.MapToSchema
|
public static WeaviateCollectionSchema MapToSchema(
string collectionName,
IEnumerable<VectorStoreRecordDataProperty> dataProperties,
IEnumerable<VectorStoreRecordVectorProperty> vectorProperties,
IReadOnlyDictionary<string, string> storagePropertyNames)
{
var schema = new WeaviateCollectionSchema(collectionName);
// Handle data properties.
foreach (var property in dataProperties)
{
schema.Properties.Add(new WeaviateCollectionSchemaProperty
{
Name = storagePropertyNames[property.DataModelPropertyName],
DataType = [MapType(property.PropertyType)],
IndexFilterable = property.IsFilterable,
IndexSearchable = property.IsFullTextSearchable
});
}
// Handle vector properties.
foreach (var property in vectorProperties)
{
var vectorPropertyName = storagePropertyNames[property.DataModelPropertyName];
schema.VectorConfigurations.Add(vectorPropertyName, new WeaviateCollectionSchemaVectorConfig
{
VectorIndexType = MapIndexKind(property.IndexKind, vectorPropertyName),
VectorIndexConfig = new WeaviateCollectionSchemaVectorIndexConfig
{
Distance = MapDistanceFunction(property.DistanceFunction, vectorPropertyName)
}
});
}
return schema;
}
|
/// <summary>
/// Maps record type properties to Weaviate collection schema for collection creation.
/// </summary>
/// <param name="collectionName">The name of the vector store collection.</param>
/// <param name="dataProperties">Collection of record data properties.</param>
/// <param name="vectorProperties">Collection of record vector properties.</param>
/// <param name="storagePropertyNames">A dictionary that maps from a property name to the storage name that should be used when serializing it to JSON for data and vector properties.</param>
/// <returns>Weaviate collection schema.</returns>
|
https://github.com/microsoft/semantic-kernel/blob/cd84e877980187e62d86bb5bc6086d264e62ee83/dotnet/src/Connectors/Connectors.Memory.Weaviate/WeaviateVectorStoreCollectionCreateMapping.cs#L25-L60
|
cd84e877980187e62d86bb5bc6086d264e62ee83
|
semantic-kernel
|
github_2023
|
microsoft
|
csharp
|
OnnxRuntimeGenAIPromptExecutionSettings.FromExecutionSettings
|
[RequiresUnreferencedCode("This method uses reflection to serialize and deserialize the execution settings, making it incompatible with AOT scenarios.")]
[RequiresDynamicCode("This method uses reflection to serialize and deserialize the execution settings, making it incompatible with AOT scenarios.")]
public static OnnxRuntimeGenAIPromptExecutionSettings FromExecutionSettings(PromptExecutionSettings? executionSettings)
{
if (executionSettings is null)
{
return new OnnxRuntimeGenAIPromptExecutionSettings();
}
if (executionSettings is OnnxRuntimeGenAIPromptExecutionSettings settings)
{
return settings;
}
var json = JsonSerializer.Serialize(executionSettings, executionSettings.GetType());
return JsonSerializer.Deserialize<OnnxRuntimeGenAIPromptExecutionSettings>(json, JsonOptionsCache.ReadPermissive)!;
}
|
/// <summary>
/// Convert PromptExecutionSettings to OnnxRuntimeGenAIPromptExecutionSettings
/// </summary>
/// <param name="executionSettings">The <see cref="PromptExecutionSettings"/> to convert to <see cref="OnnxRuntimeGenAIPromptExecutionSettings"/>.</param>
/// <returns>Returns the <see cref="OnnxRuntimeGenAIPromptExecutionSettings"/> object.</returns>
|
https://github.com/microsoft/semantic-kernel/blob/cd84e877980187e62d86bb5bc6086d264e62ee83/dotnet/src/Connectors/Connectors.Onnx/OnnxRuntimeGenAIPromptExecutionSettings.cs#L22-L39
|
cd84e877980187e62d86bb5bc6086d264e62ee83
|
semantic-kernel
|
github_2023
|
microsoft
|
csharp
|
QdrantVectorStoreRecordCollectionTests.CanCreateCollectionWithMismatchedDefinitionAndType
|
[Fact]
public void CanCreateCollectionWithMismatchedDefinitionAndType()
{
// Arrange.
var definition = new VectorStoreRecordDefinition()
{
Properties = new List<VectorStoreRecordProperty>
{
new VectorStoreRecordKeyProperty("Id", typeof(ulong)),
new VectorStoreRecordDataProperty("Text", typeof(string)),
new VectorStoreRecordVectorProperty("Embedding", typeof(ReadOnlyMemory<float>)) { Dimensions = 4 },
}
};
// Act.
var sut = new QdrantVectorStoreRecordCollection<SinglePropsModel<ulong>>(
this._qdrantClientMock.Object,
TestCollectionName,
new() { VectorStoreRecordDefinition = definition, PointStructCustomMapper = Mock.Of<IVectorStoreRecordMapper<SinglePropsModel<ulong>, PointStruct>>() });
}
|
/// <summary>
/// Tests that the collection can be created even if the definition and the type do not match.
/// In this case, the expectation is that a custom mapper will be provided to map between the
/// schema as defined by the definition and the different data model.
/// </summary>
|
https://github.com/microsoft/semantic-kernel/blob/cd84e877980187e62d86bb5bc6086d264e62ee83/dotnet/src/Connectors/Connectors.Qdrant.UnitTests/QdrantVectorStoreRecordCollectionTests.cs#L530-L549
|
cd84e877980187e62d86bb5bc6086d264e62ee83
|
semantic-kernel
|
github_2023
|
microsoft
|
csharp
|
PromptTemplateConfigExtensions.SetMaxTokens
|
internal static void SetMaxTokens(this PromptTemplateConfig config, int maxTokens)
{
var executionSettings = config.ExecutionSettings;
foreach (var setting in executionSettings)
{
if (setting.Value.ExtensionData is not null)
{
setting.Value.ExtensionData["max_tokens"] = maxTokens;
}
}
}
|
/// <summary>
/// Set the max_tokens request setting to be used by OpenAI models
/// </summary>
/// <param name="config">PromptTemplateConfig instance</param>
/// <param name="maxTokens">Value of max tokens to set</param>
|
https://github.com/microsoft/semantic-kernel/blob/cd84e877980187e62d86bb5bc6086d264e62ee83/dotnet/src/Experimental/Orchestration.Flow/Extensions/PromptTemplateConfigExtensions.cs#L15-L25
|
cd84e877980187e62d86bb5bc6086d264e62ee83
|
semantic-kernel
|
github_2023
|
microsoft
|
csharp
|
DaprKernelProcessFactory.StartAsync
|
public static async Task<DaprKernelProcessContext> StartAsync(this KernelProcess process, KernelProcessEvent initialEvent, string? processId = null)
{
Verify.NotNull(process);
Verify.NotNullOrWhiteSpace(process.State?.Name);
Verify.NotNull(initialEvent);
// Assign the process Id if one is provided and the processes does not already have an Id.
if (!string.IsNullOrWhiteSpace(processId) && string.IsNullOrWhiteSpace(process.State.Id))
{
process = process with { State = process.State with { Id = processId } };
}
DaprKernelProcessContext processContext = new(process);
await processContext.StartWithEventAsync(initialEvent).ConfigureAwait(false);
return processContext;
}
|
/// <summary>
/// Starts the specified process.
/// </summary>
/// <param name="process">Required: The <see cref="KernelProcess"/> to start running.</param>
/// <param name="initialEvent">Required: The initial event to start the process.</param>
/// <param name="processId">Optional: Used to specify the unique Id of the process. If the process already has an Id, it will not be overwritten and this parameter has no effect.</param>
/// <returns>An instance of <see cref="KernelProcess"/> that can be used to interrogate or stop the running process.</returns>
|
https://github.com/microsoft/semantic-kernel/blob/cd84e877980187e62d86bb5bc6086d264e62ee83/dotnet/src/Experimental/Process.Runtime.Dapr/DaprKernelProcessFactory.cs#L18-L33
|
cd84e877980187e62d86bb5bc6086d264e62ee83
|
semantic-kernel
|
github_2023
|
microsoft
|
csharp
|
XunitLogger.Log
|
public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
{
this._output.WriteLine(state?.ToString());
}
|
/// <inheritdoc/>
|
https://github.com/microsoft/semantic-kernel/blob/cd84e877980187e62d86bb5bc6086d264e62ee83/dotnet/src/IntegrationTests/XunitLogger.cs#L17-L20
|
cd84e877980187e62d86bb5bc6086d264e62ee83
|
semantic-kernel
|
github_2023
|
microsoft
|
csharp
|
MixedAgentTests.OpenAIMixedAgentTestAsync
|
[Theory(Skip = "OpenAI will often throttle requests. This test is for manual verification.")]
[InlineData(false)]
[InlineData(true)]
public async Task OpenAIMixedAgentTestAsync(bool useNewFunctionCallingModel)
{
OpenAIConfiguration openAISettings = this._configuration.GetSection("OpenAI").Get<OpenAIConfiguration>()!;
Assert.NotNull(openAISettings);
// Arrange, Act & Assert
await this.VerifyAgentExecutionAsync(
this.CreateChatCompletionKernel(openAISettings),
OpenAIClientProvider.ForOpenAI(new ApiKeyCredential(openAISettings.ApiKey)),
openAISettings.ChatModelId!,
useNewFunctionCallingModel);
}
|
/// <summary>
/// Integration test for <see cref="OpenAIAssistantAgent"/> using function calling
/// and targeting Open AI services.
/// </summary>
|
https://github.com/microsoft/semantic-kernel/blob/cd84e877980187e62d86bb5bc6086d264e62ee83/dotnet/src/IntegrationTests/Agents/MixedAgentTests.cs#L36-L50
|
cd84e877980187e62d86bb5bc6086d264e62ee83
|
semantic-kernel
|
github_2023
|
microsoft
|
csharp
|
QdrantTextSearchTests.CreateTextSearchAsync
|
public override Task<ITextSearch> CreateTextSearchAsync()
{
if (this.VectorStore is null)
{
this.EmbeddingGenerator = fixture.EmbeddingGenerator;
this.VectorStore = new QdrantVectorStore(fixture.QdrantClient);
}
var options = new QdrantVectorStoreRecordCollectionOptions<HotelInfo>
{
HasNamedVectors = true,
VectorStoreRecordDefinition = fixture.HotelVectorStoreRecordDefinition,
};
var vectorSearch = new QdrantVectorStoreRecordCollection<HotelInfo>(fixture.QdrantClient, "namedVectorsHotels", options);
var stringMapper = new HotelInfoTextSearchStringMapper();
var resultMapper = new HotelInfoTextSearchResultMapper();
var result = new VectorStoreTextSearch<HotelInfo>(vectorSearch, this.EmbeddingGenerator!, stringMapper, resultMapper);
return Task.FromResult<ITextSearch>(result);
}
|
/// <inheritdoc/>
|
https://github.com/microsoft/semantic-kernel/blob/cd84e877980187e62d86bb5bc6086d264e62ee83/dotnet/src/IntegrationTests/Connectors/Memory/Qdrant/QdrantTextSearchTests.cs#L20-L39
|
cd84e877980187e62d86bb5bc6086d264e62ee83
|
semantic-kernel
|
github_2023
|
microsoft
|
csharp
|
ClientResultExceptionExtensions.ToHttpOperationException
|
public static HttpOperationException ToHttpOperationException(this ClientResultException exception)
{
const int NoResponseReceived = 0;
string? responseContent = null;
try
{
responseContent = exception.GetRawResponse()?.Content.ToString();
}
#pragma warning disable CA1031 // Do not catch general exception types
catch { } // We want to suppress any exceptions that occur while reading the content, ensuring that an HttpOperationException is thrown instead.
#pragma warning restore CA1031
return new HttpOperationException(
exception.Status == NoResponseReceived ? null : (HttpStatusCode?)exception.Status,
responseContent,
exception.Message,
exception);
}
|
/// <summary>
/// Converts a <see cref="ClientResultException"/> to an <see cref="HttpOperationException"/>.
/// </summary>
/// <param name="exception">The original <see cref="ClientResultException"/>.</param>
/// <returns>An <see cref="HttpOperationException"/> instance.</returns>
|
https://github.com/microsoft/semantic-kernel/blob/cd84e877980187e62d86bb5bc6086d264e62ee83/dotnet/src/InternalUtilities/openai/Extensions/ClientResultExceptionExtensions.cs#L19-L38
|
cd84e877980187e62d86bb5bc6086d264e62ee83
|
semantic-kernel
|
github_2023
|
microsoft
|
csharp
|
ProcessStateMetadataFactory.KernelProcessToProcessStateMetadata
|
public static KernelProcessStateMetadata KernelProcessToProcessStateMetadata(KernelProcess kernelProcess)
{
KernelProcessStateMetadata metadata = new()
{
Name = kernelProcess.State.Name,
Id = kernelProcess.State.Id,
VersionInfo = kernelProcess.State.Version,
StepsState = [],
};
foreach (KernelProcessStepInfo step in kernelProcess.Steps)
{
metadata.StepsState.Add(step.State.Name, step.ToProcessStateMetadata());
}
return metadata;
}
|
/// <summary>
/// Captures Kernel Process State into <see cref="KernelProcessStateMetadata"/>
/// </summary>
/// <returns><see cref="KernelProcessStateMetadata"/></returns>
|
https://github.com/microsoft/semantic-kernel/blob/cd84e877980187e62d86bb5bc6086d264e62ee83/dotnet/src/InternalUtilities/process/Abstractions/KernelProcessStateMetadataFactory.cs#L14-L30
|
cd84e877980187e62d86bb5bc6086d264e62ee83
|
semantic-kernel
|
github_2023
|
microsoft
|
csharp
|
Verify.NotNull
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static void NotNull([NotNull] object? obj, [CallerArgumentExpression(nameof(obj))] string? paramName = null)
{
#if NET
ArgumentNullException.ThrowIfNull(obj, paramName);
#else
if (obj is null)
{
ThrowArgumentNullException(paramName);
}
#endif
}
|
/// <summary>
/// Equivalent of ArgumentNullException.ThrowIfNull
/// </summary>
|
https://github.com/microsoft/semantic-kernel/blob/cd84e877980187e62d86bb5bc6086d264e62ee83/dotnet/src/InternalUtilities/src/Diagnostics/Verify.cs#L33-L44
|
cd84e877980187e62d86bb5bc6086d264e62ee83
|
semantic-kernel
|
github_2023
|
microsoft
|
csharp
|
MathPlugin.Add
|
[KernelFunction, Description("Adds an amount to a value")]
[return: Description("The sum")]
public int Add(
[Description("The value to add")] int value,
[Description("Amount to add")] int amount) =>
value + amount;
|
/// <summary>
/// Returns the addition result of initial and amount values provided.
/// </summary>
/// <param name="value">Initial value to which to add the specified amount.</param>
/// <param name="amount">The amount to add as a string.</param>
/// <returns>The resulting sum as a string.</returns>
|
https://github.com/microsoft/semantic-kernel/blob/cd84e877980187e62d86bb5bc6086d264e62ee83/dotnet/src/Plugins/Plugins.Core/MathPlugin.cs#L18-L23
|
cd84e877980187e62d86bb5bc6086d264e62ee83
|
semantic-kernel
|
github_2023
|
microsoft
|
csharp
|
GoogleTextSearch.DefaultTextSearchResultMapper.MapFromResultToTextSearchResult
|
public TextSearchResult MapFromResultToTextSearchResult(object result)
{
if (result is not global::Google.Apis.CustomSearchAPI.v1.Data.Result googleResult)
{
throw new ArgumentException("Result must be a Google Result", nameof(result));
}
return new TextSearchResult(googleResult.Snippet) { Name = googleResult.Title, Link = googleResult.Link };
}
|
/// <inheritdoc />
|
https://github.com/microsoft/semantic-kernel/blob/cd84e877980187e62d86bb5bc6086d264e62ee83/dotnet/src/Plugins/Plugins.Web/Google/GoogleTextSearch.cs#L288-L296
|
cd84e877980187e62d86bb5bc6086d264e62ee83
|
semantic-kernel
|
github_2023
|
microsoft
|
csharp
|
TextGenerationExtensions.GetTextContentAsync
|
public static async Task<TextContent> GetTextContentAsync(
this ITextGenerationService textGenerationService,
string prompt,
PromptExecutionSettings? executionSettings = null,
Kernel? kernel = null,
CancellationToken cancellationToken = default)
=> (await textGenerationService.GetTextContentsAsync(prompt, executionSettings, kernel, cancellationToken).ConfigureAwait(false))
.Single();
|
/// <summary>
/// Get a single text generation result for the prompt and settings.
/// </summary>
/// <param name="textGenerationService">Text generation service</param>
/// <param name="prompt">The standardized prompt input.</param>
/// <param name="executionSettings">The AI execution settings (optional).</param>
/// <param name="kernel">The <see cref="Kernel"/> containing services, plugins, and other state for use throughout the operation.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> to monitor for cancellation requests. The default is <see cref="CancellationToken.None"/>.</param>
/// <returns>Single text content generated by the remote model.</returns>
|
https://github.com/microsoft/semantic-kernel/blob/cd84e877980187e62d86bb5bc6086d264e62ee83/dotnet/src/SemanticKernel.Abstractions/AI/TextGeneration/TextGenerationExtensions.cs#L27-L34
|
cd84e877980187e62d86bb5bc6086d264e62ee83
|
semantic-kernel
|
github_2023
|
microsoft
|
csharp
|
RestApiOperationResponseConverter.CanConvertTo
|
public override bool CanConvertTo(ITypeDescriptorContext? context, Type? destinationType)
{
return destinationType == typeof(string) || base.CanConvertTo(context, destinationType);
}
|
/// <inheritdoc/>
|
https://github.com/microsoft/semantic-kernel/blob/cd84e877980187e62d86bb5bc6086d264e62ee83/dotnet/src/SemanticKernel.Abstractions/Functions/RestApiOperationResponseConverter.cs#L15-L18
|
cd84e877980187e62d86bb5bc6086d264e62ee83
|
semantic-kernel
|
github_2023
|
microsoft
|
csharp
|
PromptTemplateFactoryExtensions.Create
|
public static IPromptTemplate Create(this IPromptTemplateFactory factory, PromptTemplateConfig templateConfig)
{
Verify.NotNull(factory);
Verify.NotNull(templateConfig);
if (!factory.TryCreate(templateConfig, out IPromptTemplate? result))
{
throw new KernelException($"Prompt template format {templateConfig.TemplateFormat} is not supported.");
}
return result;
}
|
/// <summary>
/// Creates an instance of <see cref="IPromptTemplate"/> from a <see cref="PromptTemplateConfig"/>.
/// </summary>
/// <param name="factory">The factory with which to create the template.</param>
/// <param name="templateConfig">Prompt template configuration</param>
/// <returns>The created template.</returns>
/// <exception cref="KernelException">The factory does not support the specified configuration.</exception>
|
https://github.com/microsoft/semantic-kernel/blob/cd84e877980187e62d86bb5bc6086d264e62ee83/dotnet/src/SemanticKernel.Abstractions/PromptTemplate/PromptTemplateFactoryExtensions.cs#L17-L28
|
cd84e877980187e62d86bb5bc6086d264e62ee83
|
Intellenum
|
github_2023
|
SteveDunn
|
csharp
|
IEnumerableExtensions.HasExactly
|
public static bool HasExactly<TSource>(this IEnumerable<TSource> source, int count)
{
if (source is null)
{
throw new ArgumentNullException(nameof(source));
}
if (source is ICollection<TSource> collectionoft)
{
return collectionoft.Count == count;
}
if (source is ICollection collection)
{
return collection.Count == count;
}
using var enumerator = source.GetEnumerator();
while (count-- > 0)
{
if (!enumerator.MoveNext())
{
return false;
}
}
return !enumerator.MoveNext();
}
|
/// <summary>
|
https://github.com/SteveDunn/Intellenum/blob/d3cdb8826f3af62856a41a6974c76a7c5288f326/src/Intellenum/Extensions/IEnumerableExtensions.cs#L110-L137
|
d3cdb8826f3af62856a41a6974c76a7c5288f326
|
Software-Architecture-with-C-Sharp-12-and-.NET-8-4E
|
github_2023
|
PacktPublishing
|
csharp
|
initial.BuildTargetModel
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "8.0.0-preview.6.23329.4")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole<int>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("nvarchar(max)");
b.Property<string>("Name")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property<string>("NormalizedName")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.HasKey("Id");
b.HasIndex("NormalizedName")
.IsUnique()
.HasDatabaseName("RoleNameIndex")
.HasFilter("[NormalizedName] IS NOT NULL");
b.ToTable("AspNetRoles", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<int>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("ClaimType")
.HasColumnType("nvarchar(max)");
b.Property<string>("ClaimValue")
.HasColumnType("nvarchar(max)");
b.Property<int>("RoleId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("RoleId");
b.ToTable("AspNetRoleClaims", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUser<int>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("AccessFailedCount")
.HasColumnType("int");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("nvarchar(max)");
b.Property<string>("Email")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property<bool>("EmailConfirmed")
.HasColumnType("bit");
b.Property<bool>("LockoutEnabled")
.HasColumnType("bit");
b.Property<DateTimeOffset?>("LockoutEnd")
.HasColumnType("datetimeoffset");
b.Property<string>("NormalizedEmail")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property<string>("NormalizedUserName")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property<string>("PasswordHash")
.HasColumnType("nvarchar(max)");
b.Property<string>("PhoneNumber")
.HasColumnType("nvarchar(max)");
b.Property<bool>("PhoneNumberConfirmed")
.HasColumnType("bit");
b.Property<string>("SecurityStamp")
.HasColumnType("nvarchar(max)");
b.Property<bool>("TwoFactorEnabled")
.HasColumnType("bit");
b.Property<string>("UserName")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.HasKey("Id");
b.HasIndex("NormalizedEmail")
.HasDatabaseName("EmailIndex");
b.HasIndex("NormalizedUserName")
.IsUnique()
.HasDatabaseName("UserNameIndex")
.HasFilter("[NormalizedUserName] IS NOT NULL");
b.ToTable("AspNetUsers", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<int>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("ClaimType")
.HasColumnType("nvarchar(max)");
b.Property<string>("ClaimValue")
.HasColumnType("nvarchar(max)");
b.Property<int>("UserId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("UserId");
b.ToTable("AspNetUserClaims", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<int>", b =>
{
b.Property<string>("LoginProvider")
.HasColumnType("nvarchar(450)");
b.Property<string>("ProviderKey")
.HasColumnType("nvarchar(450)");
b.Property<string>("ProviderDisplayName")
.HasColumnType("nvarchar(max)");
b.Property<int>("UserId")
.HasColumnType("int");
b.HasKey("LoginProvider", "ProviderKey");
b.HasIndex("UserId");
b.ToTable("AspNetUserLogins", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<int>", b =>
{
b.Property<int>("UserId")
.HasColumnType("int");
b.Property<int>("RoleId")
.HasColumnType("int");
b.HasKey("UserId", "RoleId");
b.HasIndex("RoleId");
b.ToTable("AspNetUserRoles", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<int>", b =>
{
b.Property<int>("UserId")
.HasColumnType("int");
b.Property<string>("LoginProvider")
.HasColumnType("nvarchar(450)");
b.Property<string>("Name")
.HasColumnType("nvarchar(450)");
b.Property<string>("Value")
.HasColumnType("nvarchar(max)");
b.HasKey("UserId", "LoginProvider", "Name");
b.ToTable("AspNetUserTokens", (string)null);
});
modelBuilder.Entity("PackagesManagementDB.Models.Destination", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Country")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.Property<string>("Description")
.HasColumnType("nvarchar(max)");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.HasKey("Id");
b.HasIndex("Country");
b.HasIndex("Name");
b.ToTable("Destinations");
});
modelBuilder.Entity("PackagesManagementDB.Models.Package", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Description")
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.Property<int>("DestinationId")
.HasColumnType("int");
b.Property<int>("DurationInDays")
.HasColumnType("int");
b.Property<DateTime?>("EndValidityDate")
.HasColumnType("datetime2");
b.Property<long>("EntityVersion")
.IsConcurrencyToken()
.HasColumnType("bigint");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.Property<decimal>("Price")
.HasColumnType("decimal(18,2)");
b.Property<DateTime?>("StartValidityDate")
.HasColumnType("datetime2");
b.HasKey("Id");
b.HasIndex("DestinationId");
b.HasIndex("Name");
b.HasIndex("StartValidityDate", "EndValidityDate");
b.ToTable("Packages");
});
modelBuilder.Entity("PackagesManagementDB.Models.PackageEvent", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));
b.Property<decimal>("NewPrice")
.HasColumnType("decimal(18,2)");
b.Property<long?>("NewVersion")
.HasColumnType("bigint");
b.Property<long?>("OldVersion")
.HasColumnType("bigint");
b.Property<int>("PackageId")
.HasColumnType("int");
b.Property<int>("Type")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("PackageEvents");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<int>", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole<int>", null)
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<int>", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser<int>", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<int>", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser<int>", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<int>", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole<int>", null)
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser<int>", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<int>", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser<int>", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("PackagesManagementDB.Models.Package", b =>
{
b.HasOne("PackagesManagementDB.Models.Destination", "MyDestination")
.WithMany("Packages")
.HasForeignKey("DestinationId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("MyDestination");
});
modelBuilder.Entity("PackagesManagementDB.Models.Destination", b =>
{
b.Navigation("Packages");
});
#pragma warning restore 612, 618
}
|
/// <inheritdoc />
|
https://github.com/PacktPublishing/Software-Architecture-with-C-Sharp-12-and-.NET-8-4E/blob/bb5f06a93c7a6ca281f88b0e3e16fb1302ebf943/ch09/PackagesManagementWithTests/PackagesManagementDB/Migrations/20230717141854_initial.Designer.cs#L19-L401
|
bb5f06a93c7a6ca281f88b0e3e16fb1302ebf943
|
node-api-dotnet
|
github_2023
|
microsoft
|
csharp
|
Benchmarks.Clr.DynamicCallDotnetMethod
|
[Benchmark]
public void DynamicCallDotnetMethod()
{
_jsFunctionCallMethodDynamic.CallAsStatic(_jsHost);
}
|
// CLR-only (non-AOT) benchmarks
|
https://github.com/microsoft/node-api-dotnet/blob/956d1b14426f3c41c3464d60544c5ee486241d3f/bench/Benchmarks.cs#L263-L267
|
956d1b14426f3c41c3464d60544c5ee486241d3f
|
node-api-dotnet
|
github_2023
|
microsoft
|
csharp
|
NodeWorker.MessagePort.Unref
|
public void Unref()
{
_portRef.Run((port) => port.CallMethod("unref"));
}
|
/// <summary>
|
https://github.com/microsoft/node-api-dotnet/blob/956d1b14426f3c41c3464d60544c5ee486241d3f/src/NodeApi/Interop/NodeWorker.cs#L299-L302
|
956d1b14426f3c41c3464d60544c5ee486241d3f
|
Polyfill
|
github_2023
|
SimonCropp
|
csharp
|
EnumPolyfill.GetValues
|
public static TEnum[] GetValues<TEnum>()
where TEnum : struct, Enum
{
#if NETCOREAPPX || NETFRAMEWORK || NETSTANDARD
var values = Enum.GetValues(typeof(TEnum));
var result = new TEnum[values.Length];
Array.Copy(values, result, values.Length);
return result;
#else
return Enum.GetValues<TEnum>();
#endif
}
|
/// <summary>
|
https://github.com/SimonCropp/Polyfill/blob/b3fc2b19ec553e6971f8bb688d0116c8b61f6788/src/Polyfill/EnumPolyfill.cs#L23-L34
|
b3fc2b19ec553e6971f8bb688d0116c8b61f6788
|
Polyfill
|
github_2023
|
SimonCropp
|
csharp
|
Polyfill.GetStreamAsync
|
public static async Task<Stream> GetStreamAsync(
this HttpClient target,
string requestUri,
CancellationToken cancellationToken = default)
{
try
{
// Must not be disposed for the stream to be usable
var response = await target.GetAsync(
requestUri,
HttpCompletionOption.ResponseHeadersRead,
cancellationToken
).ConfigureAwait(false);
response.EnsureSuccessStatusCode();
return await response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false);
}
// Older versions of HttpClient methods don't propagate the cancellation token inside the exception
catch (OperationCanceledException ex) when (
ex.CancellationToken != cancellationToken &&
cancellationToken.IsCancellationRequested)
{
throw new OperationCanceledException(ex.Message, ex.InnerException, cancellationToken);
}
}
|
/// <summary>
|
https://github.com/SimonCropp/Polyfill/blob/b3fc2b19ec553e6971f8bb688d0116c8b61f6788/src/Polyfill/Polyfill_HttpClient.cs#L23-L48
|
b3fc2b19ec553e6971f8bb688d0116c8b61f6788
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.