1 var ODataBuilder = new ODataConventionModelBuilder(); 2 3 ODataBuilder.EntitySet<Player>("Players"); 4 5 var player = ODataBuilder.EntityType<Player>(); 6 7 // Function – 讀取數(shù)據(jù) 8 9 player.Function("PercentageOfAllGoals").Returns<double>(); 10 11 // Action – 請求操作 12 13 player.Action("TradePlayer").Parameter<string>(