我尝试使用 Entity Framework Core 3.1 查询存储过程。我做了一个非常简单的测试项目。
存储过程:
ALTER PROCEDURE [dbo].[prcTest]
AS
BEGIN
SET NOCOUNT ON;
select tbl_Postalcode.PST_T_PostalCode AS Postalcode
from tbl_Postalcode
END
Run Code Online (Sandbox Code Playgroud)
实体:
public class Test
{
string Postalcode { get; set; }
}
Run Code Online (Sandbox Code Playgroud)
我使用这个扩展方法,在 Stackoverflow 上找到,它稍微封装了整个事情。但没什么特别的:
ALTER PROCEDURE [dbo].[prcTest]
AS
BEGIN
SET NOCOUNT ON;
select tbl_Postalcode.PST_T_PostalCode AS Postalcode
from tbl_Postalcode
END
Run Code Online (Sandbox Code Playgroud)
然后我像这样执行查询:
var result = await _myContext.SqlQueryAsync<Test>("Exec prcTest");
Run Code Online (Sandbox Code Playgroud)
我收到这个错误:
AggregateException: One or more errors occurred. (Sequence contains no elements)
System.Threading.Tasks.Task.ThrowIfExceptional(bool includeTaskCanceledExceptions)
InvalidOperationException: Sequence contains no elements
System.Linq.ThrowHelper.ThrowNoElementsException()
System.Threading.Tasks.Task.ThrowIfExceptional(bool includeTaskCanceledExceptions) …Run Code Online (Sandbox Code Playgroud) I have this code:
<Label x:Name="questionGroupHintInfoLabel" FontAttributes="Bold" Text="Folgende Hinweismeldung wurde für die aktuelle Fragengruppe hinterlegt:">
<Label.FontSize>
<OnPlatform x:TypeArguments="NamedSize"
iOS="Small"
Android="Small" />
</Label.FontSize>
</Label>
Run Code Online (Sandbox Code Playgroud)
...and get this error:
No property, bindable property, or event found for FontSize
Run Code Online (Sandbox Code Playgroud)
What i'm doing wrong?
Thanks.