aspnet/Home
source link: https://gitter.im/aspnet/Home
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
The Home repository is the starting point for people to learn about ASP.NET Core.
People
Repo info
don't use VS front front ;)
use vscode
Thanks. Will give this a try though we use blazor.
Exception thrown: 'System.ObjectDisposedException' in System.Private.CoreLib.dll
Exception thrown: 'System.ObjectDisposedException' in System.Private.CoreLib.dll
Exception thrown: 'System.ObjectDisposedException' in System.Private.CoreLib.dll
Exception thrown: 'System.ObjectDisposedException' in System.Private.CoreLib.dll
Exception thrown: 'System.ObjectDisposedException' in System.Private.CoreLib.dll
Exception thrown: 'System.ObjectDisposedException' in System.Private.CoreLib.dll
Exception thrown: 'System.ObjectDisposedException' in System.Private.CoreLib.dll
Exception thrown: 'System.ObjectDisposedException' in System.Private.CoreLib.dll
Exception thrown: 'System.ObjectDisposedException' in System.Private.CoreLib.dll
Exception thrown: 'System.ObjectDisposedException' in System.Private.CoreLib.dll
Exception thrown: 'System.ObjectDisposedException' in System.Private.CoreLib.dll
Exception thrown: 'System.ObjectDisposedException' in System.Private.CoreLib.dll
Thanks. Will give this a try though we use blazor.
that's not what i said
Could anyone familiar with EFCore give me a hint as to what I am doing wrong? (I think it must be some stupid mistake).
Table units
is existing Postgres table and has string id
field as primary key. EFCore (5.0.0) is throwing an exception because it is looking for u.UnitId
/ u.unit_id
(if using the UseSnakeCaseNamingConvention
plugin) column despite the Column
annotation and the fluent HasColumnName API
call. Based on what I have read in the docs this should be working. Like I said, I think I must be missing something. Googling about lead to some suggestions of using fluent HasField
instead but I am not sure that is what I want (Trying it results in an error saying it cannot find an id
field so not sure what is going on there).
Gist with code: https://gist.github.com/rurounijones/c4adc0b90d4cf47fb3bc480af814a989
u.id
(as expected) and u.unit_id
(er...)
Id
then it is automatically set as the primary key so I don't need to add the [Key]
annotation, however the same issue exists even if I do add the [Key]
annotation. Id
-> id
is not the problem. It is the fact that there u.id
and also u.unit_id
in the generated SQL which happens with and without the SnakeCaseNamingConvention plugin being used or not (In which case it is looking for UnitId
)
dotnet run
or via Visual Studio
dotnet publish
, everything works fine
Why does Visual Studio support C#9 features in a dotnet core 3.1 app >_>
Depending on how this component is called, sometimes it should be an anchor element, and sometimes a div. I am trying to avoid repeating a bunch of markup in there...
MarkupString
may be the thing you want there
@_openTag
@* content *@
@_closeTag
@code {
private MarkupString _openTag;
private MarkupString _closeTag;
}
@andrewleith An option would be this primitive component, where you can pass whatever html element you want through the HtmlTag property
public class Element:ComponentBase
{
[Parameter] public RenderFragment ChildContent { get; set; }
public Dictionary<string, object> UserAttributes { get; set; } = new Dictionary<string, object>();
protected override void BuildRenderTree(RenderTreeBuilder builder)
{
base.BuildRenderTree(builder);
builder.OpenElement(0, HtmlTag);
builder.AddMultipleAttributes(1, UserAttributes);
builder.AddContent(2, ChildContent);
builder.CloseElement();
}
}
So you can use it like
<Element HtmlTag="div" class="my-class" > <div> Child Content</div> </Element>
<div class="my-class"> <div> Child Content</div> </div>
Feedback welcome - https://github.com/tomasjurasek/AspNetCore.Mvc.Routing.Localization
my signalr hub gives 403 when I try to access wss://myurl.com/hub
but it works well when I use https://myurl.com/hub
anyone here can help or just explain why this is happening ?
there is no Authorize
attribute on my Hub so there is not authentication on hub url.
File()
). How do I annotate it properly so that swagger/openAPI gets it right and I can use it for code generation? Thanks in advance :)
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK