I am pretty new to F# so please don't blame me :)
My service gives me User, Group and other objects. The userobject looks like this:
{
"id": 0,
"firstname": null,
"lastame": null,
"emailaddress": null,
"active": false,
"groups": null,
"groupcount": 0,
"createdgroups": null,
"createdgroupscount": 0,
"createdfiles": null,
"createdfilescount": 0,
"createdfolders": null,
"createdfolderscount": 0,
"createdvideos": null,
"createdvideoscount": 0,
"createdcategories": null,
"createdcategoriescount": 0
}
The group object looks like this:
{
"id": 0,
"name": null,
"description": null,
"videos": null,
"videocount": 0,
"files": null,
"filecount": 0,
"members": null,
"membercount": 0,
"creator": {
"id": 0,
"firstname": null,
"lastame": null,
"emailaddress": null,
"active": false,
"groups": null,
"groupcount": 0,
"createdgroups": null,
"createdgroupscount": 0,
"createdfiles": null,
"createdfilescount": 0,
"createdfolders": null,
"createdfolderscount": 0,
"createdvideos": null,
"createdvideoscount": 0,
"createdcategories": null,
"createdcategoriescount": 0
}
}
Now my problem is, that the creator property is type of User. And the members property is a list of users.
This is how my F# types look like, the User first:
type User =
member this.ID = 0
member this.Firstname = ""
member this.Lastname = ""
member this.Emailaddress = ""
member this.Active = false
member this.AllGroupsCount = 0
member this.Groups = List<Group>.Empty
member this.AllCreatedGroupsCount = 0
member this.CreatedGroups = List<Group>.Empty
member this.AllCreatedFoldersCount = 0
member this.CreatedFolders = List<Folder>.Empty
member this.AllCreatedFilesCount = 0
member this.CreatedFiles = List<File>.Empty
member this.AllCreatedCategoriesCount = 0
member this.CreatedCategories = List<Category>.Empty
member this.AllCreatedVideosCount = 0
member this.CreatedVideos = List<Video>.Empty
And this is the group object:
type Group =
member this.ID = 0
member this.Name = ""
member this.Description = ""
member this.Videos = List<Video>.Empty
member this.Files = List<File>.Empty
member this.Members = List<User>.Empty
member this.Creator = null
Now the problem is, when I place the Group before the User object the group says User is not defined, when I put the User before the Group, it says the Group is not defined, how can I fix this?