Hi everybody,
I'm testing and learning Devforce. I have a small application with several modules developed in Ria Services under Prims Pattern.
in order to convert all application I'm converting one module at a time.
When i test a single converted module in a simple SilverLight DevForce Application it runs well.
However when I try to run that same module within my prism infrastructure I get always errors related to "KnownTypes"
My question is:
Modules written in Ria Services Cannot coexist with modules written in DevForce?
If so why i get allways strange erros?
Example : my login Module in DevForce:
private void LoginCommand( object iView )
{
LoginManager.ConnectAsync (op =>
{
ILoginCredential credential = new FormsAuthenticationLoginCredential(userName, Password, "demo", false);
this.CurrentLoginOperation = LoginManager.LoginAsync(credential, LoginCompleted, null);
});
}
private void LoginCompleted(IdeaBlade.EntityModel.LoginOperation args)
{
if (args.CompletedSuccessfully)
{
}
else if (args.HasError)
{
//allways this error
//"Type 'erp.Web.Services.MenuItem' cannot be added to list of known types since another type 'erp.Web.Services.MenuItem' with the same data contract name 'http://schemas.datacontract.org/2004/07/erp.Web.Services:MenuItem' is already present."
}
else if (!args.Cancelled)
{
}
}
'erp.Web.Services.MenuItem' –is a class in another module based in Ria Services
This has nothing to do with the Login module.
//-------------------
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Data;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel.DomainServices.Hosting;
using System.ServiceModel.DomainServices.Server;
using System.Web;
using Eticadata.Platinum;
namespace erp.Web.Services
{
[RequiresAuthentication]
[EnableClientAccess()]
public class NavigationStructureService : DomainService
{
[Query]
public IQueryable<MenuItem> GetNavigationStructure()
[Query]
public IQueryable<moduledef> GetModulesToLoad()
}
public sealed partial class moduledef
{
[Key]
public string modulename { get; set; }
public string typename { get; set; }
}
public sealed partial class MenuItem
{
public MenuItem()
{
this.Region = "MainRegion";
this.Items = new List<MenuItem>();
}
[Key]
public string Key { get; set; }
[DataMember]
public string Text { get; set; }
[DataMember]
public string ModuleName { get; set; }
[DataMember]
public string ModuleType { get; set; }
[DataMember]
public bool IsSeparator { get; set; }
[DataMember]
public string ViewName { get; set; }
[DataMember]
public string Region { get; set; }
[DataMember]
[Include]
[Association("Items", "Key", "ParentKey")]
public List<MenuItem> Items { get; set; }
[DataMember]
public string ParentKey { get; set; }
}
public sealed partial class TabelasPesquisa
{
public TabelasPesquisa()
{
this.Items = new List<TabelasPesquisa>();
this.ItemsLista = new List<ListaPesquisas>();
}
[Key]
public string Key { get; set; }
[DataMember]
public string Text { get; set; }
[DataMember]
public string Command { get; set; }
[DataMember]
[Include]
[Association("Items", "Key", "ParentKey")]
public List<TabelasPesquisa> Items { get; set; }
[DataMember]
public string ParentKey { get; set; }
[DataMember]
public List<ListaPesquisas> ItemsLista { get; set; }
}
public sealed partial class ListaPesquisas
{
public ListaPesquisas()
{
}
[DataMember]
public Guid id { get; set; }
[DataMember]
public string CommandName { get; set; }
[DataMember]
public string Nome { get; set; }
[DataMember]
public bool PorDefeito { get; set; }
[DataMember]
public bool ListaPersonalizada { get; set; }
}
}
//----------------------------------
Thanks in advance,
João salgado