I have a solution that has multiple projects. There is a MAIN project that I want to be the only external interface for my solution. In it I have provided methods which will fire off code and return results from one of the included projects. So far no problem for the test app to call the methods without including a reference to the other internal projects.
However I am making use of custom classes in my calls. these classes live in one of the internal projects and are used to pass data to the methods or get a custom response from a method or raise a custom error. These classes reside in one of the internal Projects. My problem is I cannot figure out how to get a reference to the required custom classes in the calling application without including a reference to that project the class resides in.
As an example here is a method that is made available to the consumer through the main_Project:
public class UtilitiesController
{
public static ShapeVerifyResponse VerifyShape(int shapeId, float[] dimensions)
{
ShapeVerifyResponse result = null;
IValidateShape worker = new clsGraphics();
try
{
result = worker.VerifyShape(shapeId, dimensions);
return result;
}
catch (Exception)
{
throw;
}
finally
{
if (result != null)
{
result = null;
}
if (worker != null)
{
worker = null;
}
}
}
The ShapeVerifyResponse is defined in another internal project that contains all the models and interfaces I am using. Here is that class:
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BBV2_DomainClasses.Models
{
public class ShapeVerifyResponse
{
public float Width { get; set; } // Width of shape
public float Height { get; set; } // Height of shape
public Boolean edgework { get; set; } // is edgework allowed
public ArrayList errorlist { get; set; } // list of errors
}
}
How would I code a property in the main project that returns the class of the models project to the consumer application?