Skip to content
This repository was archived by the owner on Feb 17, 2025. It is now read-only.

Commit 2a8d54a

Browse files
Ihar YakimushIhar Yakimush
authored andcommitted
update readme
1 parent 47298dc commit 2a8d54a

File tree

8 files changed

+78
-298
lines changed

8 files changed

+78
-298
lines changed

Community.OData.Linq.Demo/ExpandDemo.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
namespace Community.OData.Linq.Demo
1+
namespace Demo
22
{
33
using System;
44
using System.Collections.Generic;
55
using System.Linq;
66

7+
using Community.OData.Linq;
8+
79
public static class ExpandDemo
810
{
911
public static void SelectExpand1()

Community.OData.Linq.Demo/FilterDemo.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
namespace Community.OData.Linq.Demo
1+
namespace Demo
22
{
33
using System;
44
using System.Linq;
55

6+
using Community.OData.Linq;
7+
68
public static class FilterDemo
79
{
810
public static void BySimpleProperties()
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
namespace Demo
2+
{
3+
using System;
4+
using System.Linq;
5+
6+
using Community.OData.Linq;
7+
8+
public class Entity
9+
{
10+
public int Id { get; set; }
11+
12+
public string Name { get; set; }
13+
}
14+
15+
public static class GetStartedDemo
16+
{
17+
public static void Demo()
18+
{
19+
Entity[] items =
20+
{
21+
new Entity { Id = 1, Name = "n1" },
22+
new Entity { Id = 2, Name = "n2" },
23+
new Entity { Id = 3, Name = "n3" }
24+
};
25+
IQueryable<Entity> query = items.AsQueryable();
26+
27+
var result = query.OData().Filter("Id eq 1 or Name eq 'n3'").OrderBy("Name desc").ToArray();
28+
29+
// Id: 3 Name: n3
30+
// Id: 1 Name: n1
31+
foreach (Entity entity in result)
32+
{
33+
Console.WriteLine("Id: {0} Name: {1}", entity.Id, entity.Name);
34+
}
35+
}
36+
}
37+
}

Community.OData.Linq.Demo/OrderByDemo.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
namespace Community.OData.Linq.Demo
1+
namespace Demo
22
{
33
using System;
44
using System.Linq;
55

6+
using Community.OData.Linq;
7+
68
public static class OrderByDemo
79
{
810
public static void BySimpleProperties()

Community.OData.Linq.Demo/Program.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
1-
namespace Community.OData.Linq.Demo
1+
namespace Demo
22
{
3+
using System;
4+
35
class Program
46
{
57
static void Main(string[] args)
68
{
9+
GetStartedDemo.Demo();
10+
Console.WriteLine();
11+
712
FilterDemo.BySimpleProperties();
813
FilterDemo.ByRelatedEntity();
914
OrderByDemo.BySimpleProperties();

Community.OData.Linq.Demo/Sample.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace Community.OData.Linq.Demo
1+
namespace Demo
22
{
33
using System.Collections.Generic;
44
using System.Linq;

Community.OData.Linq.Demo/SelectDemo.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
namespace Community.OData.Linq.Demo
1+
namespace Demo
22
{
33
using System;
44
using System.Collections.Generic;
55
using System.Linq;
66

7+
using Community.OData.Linq;
8+
79
public static class SelectDemo
810
{
911
public static void OnlyNameField()

0 commit comments

Comments
 (0)