SylveonDeko
SylveonDeko
Explore posts from servers
CC#
Created by SylveonDeko on 7/26/2024 in #help
Im getting a very ambiguous error when trying to get data via aspnet
the error;
{
"type": "https://tools.ietf.org/html/rfc9110#section-15.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"errors": {
"$": [
"The input does not contain any JSON tokens. Expected the input to start with a valid JSON token, when isFinalBlock is true. Path: $ | LineNumber: 0 | BytePositionInLine: 0."
],
"model": [
"The model field is required."
]
},
"traceId": "00-553b2b7da84c52f6ab86d008eb76943f-adb629679e4bd9de-00"
}
{
"type": "https://tools.ietf.org/html/rfc9110#section-15.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"errors": {
"$": [
"The input does not contain any JSON tokens. Expected the input to start with a valid JSON token, when isFinalBlock is true. Path: $ | LineNumber: 0 | BytePositionInLine: 0."
],
"model": [
"The model field is required."
]
},
"traceId": "00-553b2b7da84c52f6ab86d008eb76943f-adb629679e4bd9de-00"
}
The code:
/// <summary>
/// Updates a guild config from the provided json and guildid
/// </summary>
/// <param name="guildId">The guildid to update a config for</param>
/// <param name="model">The json body of the model to update</param>
/// <returns></returns>
[HttpPost]
public async Task<IActionResult> UpdateGuildConfig(ulong guildId, [FromBody] GuildConfig model)
{
try
{
if (!ModelState.IsValid)
return BadRequest(ModelState);
await service.UpdateGuildConfig(guildId, model);
return Ok();
}
catch (Exception e)
{
Log.Error(e, "Error updating guild config");
return StatusCode(500);
}
}
}
/// <summary>
/// Updates a guild config from the provided json and guildid
/// </summary>
/// <param name="guildId">The guildid to update a config for</param>
/// <param name="model">The json body of the model to update</param>
/// <returns></returns>
[HttpPost]
public async Task<IActionResult> UpdateGuildConfig(ulong guildId, [FromBody] GuildConfig model)
{
try
{
if (!ModelState.IsValid)
return BadRequest(ModelState);
await service.UpdateGuildConfig(guildId, model);
return Ok();
}
catch (Exception e)
{
Log.Error(e, "Error updating guild config");
return StatusCode(500);
}
}
}
133 replies
CC#
Created by SylveonDeko on 4/8/2024 in #help
Why is docfx giving me a recursion error?
For some reason docfx is giving me a recursion error and idk why, my docfx config is very simple
{
"metadata": [
{
"src": [
{
"files": ["**.csproj"],
"src": "../src"
}
],
"dest": "./api",
"namespaceLayout": "Nested"
}
],
"build": {
"content": [
{
"files": [
"api/**.yml",
"api/index.md"
]
},
{
"files": [
"articles/**.md",
"articles/**/toc.yml",
"toc.yml",
"*.md"
]
}
],
"resource": [
{
"files": [
"images/**"
]
}
],
"overwrite": [
{
"files": [
"apidoc/**.md"
],
"exclude": [
"obj/**",
"_site/**"
]
}
],
"maxParallelism": 32,
"dest": "_site",
"globalMetadataFiles": [],
"fileMetadataFiles": [],
"template": ["default", "templates/discordfx"],
"postProcessors": [],
"markdownEngineName": "markdig",
"noLangKeyword": false,
"keepFileLink": false,
"cleanupCacheHistory": false,
"disableGitFeatures": false
}
}
{
"metadata": [
{
"src": [
{
"files": ["**.csproj"],
"src": "../src"
}
],
"dest": "./api",
"namespaceLayout": "Nested"
}
],
"build": {
"content": [
{
"files": [
"api/**.yml",
"api/index.md"
]
},
{
"files": [
"articles/**.md",
"articles/**/toc.yml",
"toc.yml",
"*.md"
]
}
],
"resource": [
{
"files": [
"images/**"
]
}
],
"overwrite": [
{
"files": [
"apidoc/**.md"
],
"exclude": [
"obj/**",
"_site/**"
]
}
],
"maxParallelism": 32,
"dest": "_site",
"globalMetadataFiles": [],
"fileMetadataFiles": [],
"template": ["default", "templates/discordfx"],
"postProcessors": [],
"markdownEngineName": "markdig",
"noLangKeyword": false,
"keepFileLink": false,
"cleanupCacheHistory": false,
"disableGitFeatures": false
}
}
4 replies
CC#
Created by SylveonDeko on 11/17/2023 in #help
Best way to limit file size when downloading a url
So im adding a way to ahve custom images for xp but dont want to have people put in custom urls that have it download a file thats over 10gb lol. Best way to avoid this? And no im not limiting to discord file uploads unless absolutely necessary
12 replies
RFRSM.GG ~ Freeroam
Created by SylveonDeko on 9/19/2023 in #📞|support
why is this happening???
43 replies
CC#
Created by SylveonDeko on 8/21/2023 in #help
❔ Im gonna lose my fucking mind over this
213 replies
RFRSM.GG ~ Freeroam
Created by SylveonDeko on 8/17/2023 in #📞|support
tf is going on? this is unplayable.
20 replies
CC#
Created by SylveonDeko on 7/26/2023 in #help
✅ Efcore help with 2 databases
I'm trying to add a config option for the user to be able to select between psql and SQLite, do I need 2 contexts for this? If so what would be the main differences between the two?
172 replies
CC#
Created by SylveonDeko on 7/13/2023 in #help
❔ Trying to migrate to another database using efcore
So im trying to use efcore to migrate from sqlite to psql, and im getting this error:
System.ArgumentOutOfRangeException: startIndex cannot be larger than length of string. (Parameter 'startIndex')
at System.String.ThrowSubstringArgumentOutOfRange(Int32 startIndex, Int32 length)
at System.String.Substring(Int32 startIndex, Int32 length)
at Microsoft.EntityFrameworkCore.Migrations.Internal.MigrationsIdGenerator.GetName(String id)
at Microsoft.EntityFrameworkCore.Migrations.Internal.MigrationsAssembly.<>c__DisplayClass13_0.<FindMigrationId>b__1(String id)
at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
at System.Linq.Enumerable.TryGetFirst[TSource](IEnumerable`1 source, Boolean& found)
at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source)
at Microsoft.EntityFrameworkCore.Migrations.Internal.MigrationsAssembly.FindMigrationId(String nameOrId)
at Microsoft.EntityFrameworkCore.Migrations.Design.MigrationsScaffolder.ScaffoldMigration(String migrationName, String rootNamespace, String subNamespace, String language)
at Microsoft.EntityFrameworkCore.Design.Internal.MigrationsOperations.AddMigration(String name, String outputDir, String contextType, String namespace)
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.AddMigrationImpl(String name, String outputDir, String contextType, String namespace)
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.AddMigration.<>c__DisplayClass0_0.<.ctor>b__0()
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.<>c__DisplayClass3_0`1.<Execute>b__0()
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.Execute(Action action)
System.ArgumentOutOfRangeException: startIndex cannot be larger than length of string. (Parameter 'startIndex')
at System.String.ThrowSubstringArgumentOutOfRange(Int32 startIndex, Int32 length)
at System.String.Substring(Int32 startIndex, Int32 length)
at Microsoft.EntityFrameworkCore.Migrations.Internal.MigrationsIdGenerator.GetName(String id)
at Microsoft.EntityFrameworkCore.Migrations.Internal.MigrationsAssembly.<>c__DisplayClass13_0.<FindMigrationId>b__1(String id)
at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
at System.Linq.Enumerable.TryGetFirst[TSource](IEnumerable`1 source, Boolean& found)
at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source)
at Microsoft.EntityFrameworkCore.Migrations.Internal.MigrationsAssembly.FindMigrationId(String nameOrId)
at Microsoft.EntityFrameworkCore.Migrations.Design.MigrationsScaffolder.ScaffoldMigration(String migrationName, String rootNamespace, String subNamespace, String language)
at Microsoft.EntityFrameworkCore.Design.Internal.MigrationsOperations.AddMigration(String name, String outputDir, String contextType, String namespace)
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.AddMigrationImpl(String name, String outputDir, String contextType, String namespace)
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.AddMigration.<>c__DisplayClass0_0.<.ctor>b__0()
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.<>c__DisplayClass3_0`1.<Execute>b__0()
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.Execute(Action action)
8 replies
CC#
Created by SylveonDeko on 3/10/2023 in #help
❔ help printing 10 barcodes on 1 4x6 label
So I need a program to create a label that has 10 barcodes on it, it's for inventory. The program itself already adds to excel and stuff for inventory but we need it to print something that contains 10 barcodes to slap on the outside of the box
6 replies
CC#
Created by SylveonDeko on 11/17/2022 in #help
❔ parse a single json property differently
So i have an existing json model that i cannot retire because some users already use it. I want to be able to parse a single property inside that json model 2 ways, the old way and the new way. how would i do that? Property and model in question: https://github.com/Pusheon/Mewdeko/blob/main/src/Mewdeko/Common/NewEmbed.cs#L70
14 replies