Archive for the ‘SCSF’ Category

h1

http://localhost/…Service.svc could not locate service dependency ‘….’

March 25, 2008

[ComponentDependency("blabla")]

bylo ve tride, ktera se vkladala do collectiony.
Pri vkladani dochazi ke Copy (asi), kazdopadne se volala ComponentDependency a vyhucelo to, protoze tato
trida nema WorkItem.Items collection.

public class FlightDetailAllTopViewStrategy : IFlightDetailTopViewStrategy
{ [ComponentDependency("blabla")]
public Flight Flight
{
    get { return _flight; }
    set { _flight = value; }
} }
http://richnewman.wordpress.com/2007/10/07/table-of-contents-for-%e2%80%98introduction-to-cabscsf%e2%80%99-articles-2/

if the object does not exist in the appropriate Items collection when we try to inject it then the CAB will throw a DependencyMissingException.
slo o to, ze jednotlive strategie dedi po jednom interfacu. Problem je, ze object builder nemuze vytvorit instanci dane strategie, kdyz je typu interface
Object builder totiz nevi, jakeho typu strategie bude.

proto se mi jako jednoduche reseni jevi tohle:

IFlightDetailTopViewStrategy Strategy
        {
            get
            {
                return(IFlightDetailTopViewStrategy)
                WorkItem.Items[Constants.Flights.ItemNames.DetailTopViewDetailStrategy];
            }
        }   
Follow

Get every new post delivered to your Inbox.