public virtual Location Save(Locationinstance)
should be
 public *override* Location Save(Locationinstance)

right?


On Thu, May 28, 2009 at 12:06 AM, TrentCioran <[email protected]> wrote:

>
> Hi,
>
> First I'm new to DP2, second, I'm trying to generate an interceptor
> but i'm getting a GeneratorException, the case is, i have a base class
> ApplicationService:
>
>    public abstract class ApplicationServiceBase<T, TR> :
> IApplicationService<T>
>        where T : DomainObject
>        where TR : IEntityOperations<T>
>    {
>        protected static ILogger LOG =
> IoCFactory.Resolve<ILoggerFactory>().GetLogger(
>            typeof (ApplicationServiceBase<T, TR>));
>
>        protected ApplicationServiceBase(TR repo)
>        {
>            Repository = repo;
>        }
>
>        #region Implementation of IQueryable<T>
>
>        public QueryResult<T> Find(QuerySpecification specification)
>        {
>            return Repository.Find(specification);
>        }
>
>        #endregion
>
>        #region Implementation of IEntityOperations<T>
>
>        public virtual T Get(int primaryKey)
>        {
>            return Repository.Get(primaryKey);
>        }
>
>        public virtual void Delete(int primaryKey)
>        {
>            Repository.Delete(primaryKey);
>        }
>
>        public virtual void Update(T instance)
>        {
>            Repository.Update(instance);
>        }
>
>        public virtual T Save(T instance)
>        {
>            return Repository.Save(instance);
>        }
>
>        #endregion
>
>        public TR Repository { get; set; }
>    }
>
> but in some situations i need to override som of the methods Save,
> Update & Delete, say a service called LocationService:
>
>   public class LocationService : ApplicationServiceBase<Location,
> IEntityOperations<Location>>, ILocationService
>    {
>        public LocationService(IEntityOperations<Location> repo)  :
> base(repo) { }
>
>        #region ILocationService Members
>
>        public virtual Location Save(Locationinstance)
>        {
>           .
>           .
>           .
>           .
>            return base.Save(instance);
>        }
>
>        #endregion
>    }
>
>
> My problem is that with this Save method in LocationService i'm
> getting the exception
>
> Found more than one method on target .....LocationService matching
> Save
>
> How can i specify which methods i want to proxify?
>
>
> Thanks
>
> TrentCioran
>
> P.S. sorry for my english =P
> >
>


-- 
Ken Egozi.
http://www.kenegozi.com/blog
http://www.delver.com
http://www.musicglue.com
http://www.castleproject.org
http://www.gotfriends.co.il

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Castle Project Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/castle-project-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to