gio735
gio735
Explore posts from servers
CC#
Created by gio735 on 9/18/2024 in #help
EF-Core unable to create migration
just got home and it worked, but I just don't understand why it stopped working the way it was, also for update-database instead of package manager just ran code normally so context.Database.Migrate(); could do the work and it did just fine. Any idea what could cause it?
15 replies
CC#
Created by gio735 on 9/18/2024 in #help
EF-Core unable to create migration
thanks will check it
15 replies
CC#
Created by gio735 on 9/18/2024 in #help
EF-Core unable to create migration
I think it's built in
15 replies
CC#
Created by gio735 on 9/18/2024 in #help
EF-Core unable to create migration
Microsoft.Extensions.Hosting?
15 replies
CC#
Created by gio735 on 9/18/2024 in #help
EF-Core unable to create migration
why might it throw such exception?
15 replies
CC#
Created by gio735 on 9/18/2024 in #help
EF-Core unable to create migration
it works just fine when I run code normally, I tried to hardcode connection string as well, but it's same.
15 replies
CC#
Created by gio735 on 7/13/2024 in #help
✅ AutoValidateForgeryToken with fetch API
Sorry, I couldn't see the message. I just added it to the fetch() headers and as value gave '@Html.AntiForgeryToken()'. made it work by adding @Html.AntiForgeryToken() as a element and setting it's value as RequestVerificationToken header
3 replies
CC#
Created by JAAAAO v2 on 6/6/2024 in #help
I'm having problem making a post in swagger. Its a one to many relationship where "Produto" is one.
I'm not the most experienced about that so someone else might have a better solution
18 replies
CC#
Created by JAAAAO v2 on 6/6/2024 in #help
I'm having problem making a post in swagger. Its a one to many relationship where "Produto" is one.
If you want to pass that collection then just passing an empty one should fix your problem, but if you are not expecting it at all I believe it's better to make a new model for request which doesn't contain it at all
18 replies
CC#
Created by JAAAAO v2 on 6/6/2024 in #help
I'm having problem making a post in swagger. Its a one to many relationship where "Produto" is one.
It's not about the class of the container there, I'm a bit lost with that response
18 replies
CC#
Created by JAAAAO v2 on 6/6/2024 in #help
I'm having problem making a post in swagger. Its a one to many relationship where "Produto" is one.
As for ICollection it's just an interface so it doesn't restrict you only to list and can use other classes which extend ICollection<T>
18 replies
CC#
Created by JAAAAO v2 on 6/6/2024 in #help
I'm having problem making a post in swagger. Its a one to many relationship where "Produto" is one.
$codegif
18 replies
CC#
Created by JAAAAO v2 on 6/6/2024 in #help
I'm having problem making a post in swagger. Its a one to many relationship where "Produto" is one.
Also
18 replies
CC#
Created by JAAAAO v2 on 6/6/2024 in #help
I'm having problem making a post in swagger. Its a one to many relationship where "Produto" is one.
I'd assume ICollection<MovimentacaoProduto>? Means that it's part of it
18 replies
CC#
Created by JAAAAO v2 on 6/6/2024 in #help
I'm having problem making a post in swagger. Its a one to many relationship where "Produto" is one.
You should request only what's needed, make a new model for such cases
18 replies
CC#
Created by gio735 on 4/30/2024 in #help
Unable to get localization to get to work in MVC .net8
um, setting Designer.cs culture solves it, so was I perhaps supposed to manually read cookie and assign it?
8 replies
CC#
Created by gio735 on 4/30/2024 in #help
Unable to get localization to get to work in MVC .net8
this doesn't really make sense
8 replies
CC#
Created by gio735 on 4/30/2024 in #help
Unable to get localization to get to work in MVC .net8
and well... even like that, it changes to %3D and %7C when written in cookie
8 replies
CC#
Created by gio735 on 4/30/2024 in #help
Unable to get localization to get to work in MVC .net8
To create cookie and assign value, I'm using method almost same as shown in Microsoft documentation
public IActionResult SetLanguage(string culture = "en-US", string returnUrl = "/")
{
Console.WriteLine( WebText.Culture);
Response.Cookies.Append(
CookieRequestCultureProvider.DefaultCookieName,
CookieRequestCultureProvider.MakeCookieValue(new RequestCulture(culture)),
new CookieOptions { Expires = DateTimeOffset.UtcNow.AddYears(1) }
);

return LocalRedirect(returnUrl);
}
public IActionResult SetLanguage(string culture = "en-US", string returnUrl = "/")
{
Console.WriteLine( WebText.Culture);
Response.Cookies.Append(
CookieRequestCultureProvider.DefaultCookieName,
CookieRequestCultureProvider.MakeCookieValue(new RequestCulture(culture)),
new CookieOptions { Expires = DateTimeOffset.UtcNow.AddYears(1) }
);

return LocalRedirect(returnUrl);
}
right now I changed value of cookie manually and refreshed the page, but it's same, also would replacing it with $"c={culture}|uic={culture}" be appropriate?
8 replies
CC#
Created by gio735 on 4/30/2024 in #help
Unable to get localization to get to work in MVC .net8
to access elements I'm using {FileName}.{ItemName} format
8 replies