c# - 快速操作:字段类生成器
问题描述
是否有一个工具visual studio
c#
可以生成类的字段?假设我们有一个class
名字Contact
:
public class Contact
{
public int Id { get; set; }
public string Name { get; set; }
public DateTime? CreatedAt { get; set; }
public string CreatedBy { get; set; }
public DateTime? UpdatedAt { get; set; }
public string UpdatedBy { get; set; }
public bool? Active { get; set; }
// ....Some more Fields below
}
当我键入Contact
then 时,就像我键入道具时一样,并将在下面生成此字段
Contact o = new Contact // Generated
{
Id = o1.Id,
Name = o1.Name
// Some more fields generated here
};
注意:prop
这里只是一个例子。
解决方案
推荐阅读
- python - Python:删除/复制文件。第一次运行成功,现在没有
- javascript - 根据数量更新价格 HTML, JS
- python - (NMF) 每次调用方法时,在 NMF 中计算一致性会产生不同的输出
- python - Python Discord Music Bot - 创建队列 - 自动播放下一首歌曲
- stripe-payments - Stripe Payment Intent:更新并确认付款金额的变化
- typescript - 使用 typescript 编译 d3 示例时出错
- php - Laravel 中不缓存追加
- flutter - 更改底部导航栏图标的活动颜色
- prolog - Prolog,从图中删除节点
- c - 如何通过管道发送序列化的动态分配结构