You are here:   Community
Register   |  Login

ActiveSocial

  • May 16

  • John G John G

    I have a best practices question...I often have data that is common to multiple tables such as Notes or Attachments that may be identical for Accounts, Contacts, Projects, Tasks, etc.   I see two options...

    One way is to create a Notes table and add a 'Zero or One' relationship to all tables that need that info.  That gives me a 'zero or one' relationship to all the other tables that have notes.  That has the added step of removing all those fields from new LS screens which is a little goofy.  That seems to work fine as long as the 'notes' are always optional.  But what if Notes are optional for Accounts but required for Tasks.  I don't think it's possible with this design.

    The other option is to create separate tables for each such as ProjectNotes, AccountNotes, TaskNotes. That option certainly works and gives the ability to make Notes required or not required on a case by case bases as needed. However, since each table has the exact same columns it doesn't feel right...but it does give the most flexibility in some ways but adds complexity in others if for instance we wanted to search all Notes.  

    I think both ways work...it seems a common issue.  Any thoughts on the best way to handle this in LightSwitch?

    Thanks,

    John


    2 days ago
  • May 11

  • KDINNY KDINNY Michael,
    Thanks for the prompt (and encouraging!) response.
    Will do as instructed and let you know the outcome.
    Thanks again,
    KDINNY.
    about 1 weeks ago
  • May 10

  • Michael Washington Michael Washington The average project will be about 50 megs but basically you just copy the root folder and everything below it. When you download code that I posted on this site that is what I do.
    about 1 weeks ago
  • KDINNY KDINNY Can anybody please walk me through how I can effectively copy an existing LS Project (and its accompanying Extensions) over to a new piece of hardware?

    My concern is that there are so many files in soooo many locations - that I might miss something important.

    Also - any guidance about how to get new projects running on virtual machines - or is it pretty much the same drill as for 'from physical to physical'?

    Any and all suggestions will be gratefully received.

    Thanks,

    KDINNY.
    about 1 weeks ago
  • May 08

  • josua marpaung josua marpaung Dear Hgminerva or all,
    I assume that your accounting system should be a lot of business logic/domain logic.
    Where you put the business logic, as well we know that lightswitch does not support to call method server(CMII).
    Currently we are using lightswitch to build an application that has complex business logic, but i just wondered about that.
    any suggestion, highly appreciated.

    thanks.
    about 2 weeks ago
  • April 29

  • Steve Steve Hi,

    I created a lightswitch test application - AppA and published it on Azure.

    The application is a test app and so I have published as HTTP only, not requiring an SSL certificate.

    The application exposes an oData end point.

    If I login to the application I'm required to provide a username and password by Lightswitch in the usaul manner. I am then presented with the basic screens I created.

    If I view the exposed oData service I can review the metadata etc...

    So far so good...

    I then in AppB add a new data source referencing the Svc URL from AppA. The Data Source Wizard then provides me an opportunity to authenticate the connection, and I select "other credentials", as I'm using Forms Authentication.

    When I press Test Connection I get an error message reporting Could not Authenticate user:. Access is denied OK

    Anybody have any ideas?

    Have I missed a step somewhere along the ling?

    Thanks,

    Steve

    about 3 weeks ago
  • Steve Steve I created a test program originally to test if LS exposed Service Operations... and it didn't for that test case.

    However whilst working on something - a project with a custom RIA Service included as a Data Source, it has exposed the Service Operations...

    A little more investigation is required to get to the bottom of this.
    about 3 weeks ago
  • April 28

  • Michael Washington Michael Washington I really appreciate you notifying us about that. If you have any more information perhaps you can make a separate post about all your findings regarding Azure and performance with LightSwitch. This is important information everyone needs to know. Also I can ask Microsoft for their response to any issues you discover.
    about 3 weeks ago
  • Steve Steve Think I've got to the bottom of this issue now.

    For test purposes I published the LS application on an ExtraSmall Compute Instance, keeping my costs down. Thats worked fine for most things I'm doing with development.

    However in this case I've added a RIA Service to communicate to a remote end point, outside of Azure. It appears that during 9-2pm GMT the ExtraSmall Instance runs fine.

    The ExtraSmall Instance is defined as having "low I/O performance". I haven't got to the bottom of what that really means. So today I deployed the application with a Small Compute Instance and it runs all day long.

    I'll do some more testing but there are various mutterings about outbound comms being problematic for ExtraSmall compute instances.

    Thanks,

    Steve

    about 3 weeks ago
  • Steve Steve I did a bit more digging about and looked at the plumbing put in place.

    1) Created a Website and presented a WCF Data Service (oData) End Point

    I created a WCF Data Service web application and exposed my own WCF Data Service operations, one of which had a parameter.

    The metadata for the service identifies this operation as GetUsersByName. Here is the meta data for the test end point created by the WCF Data Service.



      ataServices xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" mataServiceVersion="1.0">
       
         
           
             
           

           
           

    about 3 weeks ago
  • Michael Washington Michael Washington I understand the situation now.

    To bring your concerns to the LightSwitch team post in their forum at:
    http://social.msdn.microsoft.com/Fo...ta/threads
    about 3 weeks ago
  • Steve Steve Hopefully this helps explain things in little more clearly. <br /> <br /> <strong>1) RIA Service <br /> </strong> <br /> I created a RIA Service and attached it into my project. I broadly followed your articles, works like a charm. <br />  <br /> <span style="color: #a5a5a5;"><em>public class Forms : DomainService <br /> { <br /> SvcForms.forms wsForms = null; <br /> <br /> private T ToValue<T>(System.Data.DataRow Row, string ID, T DefaultValue) <br /> { <br /> T _result = DefaultValue; <br /> <br /> object _Value = Row[ID]; <br /> <br /> string _X = _Value.ToString(); <br /> <br /> if (_Value != null) <br /> { <br /> try <br /> { <br /> _result = (T)Row[ID]; <br /> } <br /> catch <br /> { <br /> _result = DefaultValue; <br /> } <br /> } <br /> <br /> return _result; <br /> } <br /> <br /> public Forms() <br /> { <br /> wsForms = new SvcForms.Forms(); <br /> } <br /> <br /> protected override int Count<T>(IQueryable<T> query) <br /> { <br /> return query.Count(); <br /> } <br /> <br /> <br /> // ------------------------------------------------------------------------------- <br /> // GetUser <br /> // ------------------------------------------------------------------------------- <br /> // <br /> // Stub Query <br /> // <br /> // ------------------------------------------------------------------------------- <br /> <br /> [Query(IsDefault = true)] <br /> public IQueryable<User> GetUser() <br /> { <br /> List<User> _result = new List<User>(); <br /> return _result.AsQueryable(); <br /> } <
    about 3 weeks ago
  • April 27

  • Michael Washington Michael Washington I guess I am not able to fully understand the problem.
    about 3 weeks ago
  • Steve Steve Using the screen/client is an option but i was looking to expose the RIA Service Data Source via oData, putting it the screen seems like a retrograde step given the oData push.
    about 3 weeks ago
  • Steve Steve I don't think the link is a work around for the issue I'm addressing above. You don't have a query defined in your RIA service that takes a parameter or parameters. You have just the default query being returned which performs the shaping/calc required.

    A RIA Service can expose in addition to the default query, additional queries that can take parameters, and return a result set/entity as per your link/article. From imperical testing an Entity exposed in AppA, built from a RIA service, and with queries defined, and queries with parameters more importantly, are not exported to AppB. They are visible in AppA, but not exported to AppB.

    This seems pretty limiting to me, assuming there isn't a work around??

    Thanks, Steve
    about 3 weeks ago
  • Michael Washington Michael Washington Do you have to have the WCF RIA Service make more than one call before it returns data? I would rather put code in the LightSwitch screen that orchestrated making the multiple calls, perhaps even a 'page of data' at a time. The LightSwitch Silverlight screen will_never_time_out.
    about 3 weeks ago
  • Michael Washington Michael Washington In App A you can make WCF RIA Services (that will then be exposed by App A as OData services) that can be consumed by App B, correct?
    I think I understand that you want this to be automatic?
    However, this 'work around' will work?
    LightSwitch also does not expose computed properties over OData, they say they CAN do it but since their is a 'work around' (again using WCF RIA Services: http://lightswitchhelpwebsite.com/B...vices.aspx ) that it is not high as a priority.
    about 3 weeks ago
  • Michael Washington Michael Washington Sounds good. It will help others convince their teams to give LightSwitch a shot.
    about 3 weeks ago
  • Steve Steve I'd created a RIA Service, attached it to my LS Project, published it, ran it, and it worked as I expected, fantastic...

    The RIA Service connects to a remote system using a web reference, it makes a couple of quick calls, and returns some data, all within a fews seconds normally.

    Demo - How great is this....

    Doesn't it always break when you demo it?? So a couple of hours later I tried a demo to another member of the team and it started reporting an error message.

    "An error occurred while running the command. Error details: Unable to connect to remote server"

    The timeout is consistent, always ay 30 seconds, and when it works, it connects within a few seconds.

    What I noticed was that it tended to work between 8am and 2pm GMT, and then tends to fail between 2pm and right around until 2-3am (haven't bothered staying up to find out precisely :-))

    So that would seem to imply Azure is getting hammered and slowing right down, and or traffic within the data centre is high.... but whatever the issue there is some time based load having an impact.

    Has anybody else seen this issue? The region we are hosted in is Northern Europe, by the way.

    Possible Resolution

    I guess I just need to amend the webconfig/service setup to extend the timeout.

    I've rebooted the roles, had one role, two roles, just tried various basic checks/tests but it looks like i need the timeout extended, which I tried in code, but it consistently failed at 30 seconds.

    Anybody seen this kind of issue with LS??

    Thanks,

    Steve

    about 3 weeks ago
  • Steve Steve Great article here, nice short set of worked examples.

    http://www.codeproject.com/Articles...a-Services

    The issue/question was specifically relating to how VS11/Lightswitch deals with Queries added to a Data Source Entity an App (AppA), and then how this is subsequently exposed and projected into AppB.

    My initial investigations would seem to indicated that they aren't projected and made available as queries within any other consuming application, ie AppB.

    In summary

       AppA
          CustomData (derived locally from RIA Service)
             EntityA
               GetEntityAByX(...)
               GetEntityAByY(...)
             EntityA
               GetEntityBByX(...)
               GetEntityBByY(...)

       AppB
          CustomData (derived from AppA)
             EntityA
               
             EntityB
               

    Queries in AppA are not projected across into AppB.

    If your RIA service in AppA is expecting you to pass params and the default query is stubbed to avoid negative system performance, then this isn't got to work for you.

    I'm hoping I've missed some switch or flag to make this burst into life....


    about 3 weeks ago