Hello I am using the free version of the light speed and I am getting a lot of issues .In the tutorial its feels simple but in practical its not .Here are the list of issues I am facing .
1)Always I am getting some kind of issue in code generation
2)Here is my code .
app.cofig
<configuration>
<configSections>
<section name="lightSpeedContexts"
type="Mindscape.LightSpeed.Configuration.LightSpeedConfigurationSection, Mindscape.LightSpeed" />
</configSections>
<connectionStrings>
<add name ="Dev" connectionString="Data Source=.;Initial Catalog=AdventureWorks2012;User ID=sa;Password=$sqladmin12;MultipleActiveResultSets=true"/>
</connectionStrings>
<lightSpeedContexts>
<add name="default"
connectionStringName="Dev"
dataProvider="SqlServer2005"
identityMethod="IdentityColumn"
pluralizeTableNames="False"/>
</lightSpeedContexts>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
Main file
private static LightSpeedContext<LightSpeedModel1UnitOfWork> _context;
static void Main(string[] args)
{
_context = new LightSpeedContext<LightSpeedModel1UnitOfWork>("default");
_context.Logger = new Mindscape.LightSpeed.Logging.ConsoleLogger();
_context.VerboseLogging = true;
_context.IdentityMethod = IdentityMethod.IdentityColumn;
using (var vow = _context.CreateUnitOfWork())
{
var pepl = vow.Departments.Single(per => per.DepartmentId == 1);
}
Here is the query generated
SELECT
Person.BusinessEntityContact.*
FROM
(
SELECT
**Person.BusinessEntityContact.Id AS [Person.BusinessEntityContact.Id],** ---------------------**
> `(**Why this is generated`**
** )
Person.BusinessEntityContact.BusinessEntityID AS [Person.BusinessEntityCon
tact.BusinessEntityID],
Person.BusinessEntityContact.ContactTypeID AS [Person.BusinessEntityContac
t.ContactTypeID],
Person.BusinessEntityContact.CreatedOn AS [Person.BusinessEntityContact.Cr
eatedOn],
Person.BusinessEntityContact.ModifiedDate AS [Person.BusinessEntityContact
.ModifiedDate],
Person.BusinessEntityContact.PersonID AS [Person.BusinessEntityContact.Per
sonID],
Person.BusinessEntityContact.rowguid AS [Person.BusinessEntityContact.rowg
uid],
Person.BusinessEntityContact.UpdatedOn AS [Person.BusinessEntityContact.Up
datedOn],
ROW_NUMBER() OVER(ORDER BY Person.BusinessEntityContact.Id) as RowNumber
FROM
Person.BusinessEntityContact
WHERE
Person.BusinessEntityContact.BusinessEntityID = 292
)
Person.BusinessEntityContact
WHERE
RowNumber <= 2
As u can see this Id that is generated is killing me .How can i remove this unwanted Id mapping .
The error that I am getting on my console is
Unhandled Exception: System.Data.SqlClient.SqlException: Incorrect syntax near '
.'.