Brian Stewart - 9 - Mar 16, 2015

 
Hi folks quick help required if possible i’m trying to do (what i thought would be simple) a quick query.

The object i’m using
 [Schema(“Prospect”)]
    [Alias(“TrackedSource”)]
    public class ProspectSource
    {
        [PrimaryKey]
        [AutoIncrement]
        public int Id { get; set; }

       public int? ClientId { get; set; }

 public string Name { get; set; }
  public bool IsActive { get; set; }
}


i’m running the following command

string source =“unknown”;
int clientId = 10000;
  var foundSource = Db.Select<ProspectSource>(q => (q.Name.Contains(source.Trim()) || (q.Name.Contains(source.Trim()) && q.ClientId == clientId) && q.IsActive)).FirstOrDefault();

but running this gives me the following generated sql

SELECT “Id”,  “ClientId”, “Name”, "IsActive"
FROM "TrackedSource"
WHERE (upper(“Name”) like ‘%UNKNOWN%’ OR ((upper(“Name”) like ‘%UNKNOWN%’ AND (“ClientId” = 10000)) AND “IsActive”=1))


and of course the error - TrackedSource can not be found is generated.

I was expected the following sql to be generated

SELECT “Id”,  “ClientId”, “Name”, "IsActive"
FROM “Prospect”."TrackedSource"
WHERE (upper(“Name”) like ‘%UNKNOWN%’ OR ((upper(“Name”) like ‘%UNKNOWN%’ AND (“ClientId” = 10000)) AND “IsActive”=1))


anyone with any ideas why this could be happening

using latest version of Servicestack

Brian Stewart:

using servicestack 4.0.38

I believe this should be resolved with the latest v4.0.39 on MyGet: 
https://github.com/ServiceStack/ServiceStack/wiki/MyGet

Brian Stewart:

Hi thanks Demis… never used myget at all. do u have a change log for 4.0.39 yet so i can see whats actually resolved ? thanks again and keep up the great work with the servicestack suite

Using MyGet packages just requires a couple of instructions shown in the link above. You can check the commit history for any changes, but we only spend the time to group them when preparing the release notes just before each release.

Brian Stewart:

+Demis Bellot  Thanks for your help once again :wink:

Yep, all MyGet packages go through the same process as official packages, e.g. have passed all CI tests. Only difference is that they’re published more frequently to MyGet instead of NuGet. Other than that they’re the same and you can just consider them as “interim” official releases.