小编Jam*_*ler的帖子

EF Core 无法通过聚合构造函数传递值类型

问题

我需要初始化一个新的域实体,该实体通过其构造函数接受一个基本值对象。域背后的持久化机制是由 Entity Framework Core 驱动的 SQL server。

我遇到的问题是,当 EF Core 尝试创建数据库架构时,它无法将值对象参数与​​任何映射属性相关联。

我在这里缺少什么?任何帮助将非常感激。

我的简化域模型

public sealed class Address
{
    public string StreetAddress { get; }

    public string Town { get; }

    public string PostalCode { get; }

    internal Address(string streetAddress, string town, string postalCode)
    {
        ...
    }
}

public sealed class PropertyListing
{
    public Guid Id { get; }

    public string Title { get; }

    public string Description { get; }

    public Address Address { get; }

    public decimal GuidePrice …
Run Code Online (Sandbox Code Playgroud)

c# entity-framework-core

5
推荐指数
0
解决办法
2113
查看次数

无法获取正在运行/当前进程的列表?

我正在尝试使用以下代码在Win7上获取正在运行的进程/会话列表,该代码可在Internet中找到.但它不起作用?我没有任何编译错误.

namespace CurrentProcessesLister
{
   class Program
   {
      static void Main(string[] args)
      {
          Process[] runningProcesses = Process.GetProcesses();
          var currentSessionID = Process.GetCurrentProcess().SessionId; 
          Process[] sameAsthisSession = (from c in runningProcesses where c.SessionId ==    currentSessionID select c).ToArray(); 

          foreach (var p in sameAsthisSession) 
          { 
              Trace.WriteLine(p.ProcessName); 
          }
      }
  }
}
Run Code Online (Sandbox Code Playgroud)

c# session process

1
推荐指数
1
解决办法
866
查看次数

标签 统计

c# ×2

entity-framework-core ×1

process ×1

session ×1