
namespace RadGridViewCrash.Web.Models
{
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.ComponentModel.DataAnnotations;
    using System.Linq;
    using System.ServiceModel.DomainServices.Hosting;
    using System.ServiceModel.DomainServices.Server;


    // TODO: Create methods containing your application logic.
    [EnableClientAccess()]
    public class TestDomainService : DomainService
    {
        [Query(IsDefault = true)]
        public List<CompanySearchResult> GetEntity_CompanySearchResult()
        {
            List<CompanySearchResult> Result = new List<CompanySearchResult>();
            for(int i = 0;i<3;i++)
            {
                    int[] ChildCompanyIDs = new int[] { };
                    Result.Add(new CompanySearchResult()
                    {
                        CompanyID = i,
                        CompanyName = "Test Company " + i.ToString(),
                        ParentCompanyID = null,
                        Address = "Test Address " + i.ToString(),
                        ZipCode = "1234 AB",
                        City = "Test City",
                        Country = "Test Country",
                        ChildCompanies = 0,
                        ChildCompanyIDs = ChildCompanyIDs
                    });
                }
            return Result;
        }
    }
}


