Odata,EF一些常用的配置

2021-08-19 22:55:56 字數 1184 閱讀 4324

記錄一些用ef建表,odata配置,還有會忘了的一些東西

enable-migrations //在資料庫裡建乙個表

add-migration //新增

update-database //更新資料

install-package entityframework //新增最新版的ef

install-package microsoft.aspnet.odata //新增最新版的odata

install-package jquery //新增最新版的jquery

在ef類裡面新增主外來鍵

[table("users")] //建立乙個表,表名為users

public class susers

[required] //非空

public string uname

public string password

public string nname

public string ***

public int nationcode

public datetimeoffset birthday //datetimeoffset就是datetime型別

[foreignkey("nationcode")] //定義乙個外來鍵,外來鍵為nationcode

public virtual nation nation //外來鍵

}public class nation

public string nationname

public virtual icollectionsusers //主鍵}}

//配置web.config

//配置odata

config.count().select().orderby().filter().expand().maxtop(null);

odatamodelbuilder builder = new odataconventionmodelbuilder();

builder.entityset("users");

config.mapodataserviceroute(

routename: "odata",

routeprefix: "odata",

model: builder.getedmmodel());

apache flume 常用的一些配置

1.http source到hdfs sink 根據傳入json不同分配道不同hive表,兩種方法 注 hive表只是hdfs乙個資料夾 建立多個通道 hdfs sink 不同hdfs.path對應不同sink agent.sinks.kafka2hive general.type hdfs age...

vim的一些常用配置

set nu 顯示行數 set hlsearch 高亮度查詢 set backspace 2 可以使用退格鍵刪除任意字元,當為01時,僅可刪除輸入字元,不可刪除已存在的字元 set autoindent 自動縮排 set ruler 可顯示最後一行狀態 set showmode 左下角那一行的狀體 ...

docker的常用的一些配置

echo storage driver overlay2 registry mirrors etc docker daemon.json sudo systemctl restart docker.service echo etc docker daemon.json systemctl resta...