Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. LINQ
  4. Two questions about Linq to Sql Classes [modified]

Two questions about Linq to Sql Classes [modified]

Scheduled Pinned Locked Moved LINQ
databasequestioncsharplinq
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Q Offline
    Q Offline
    Quake2Player
    wrote on last edited by
    #1

    Hi, Lets say I have a db with two tables: Table Users (UserId, Name) Table Messages (MessageId, FromId, ToId, ...) FromId and ToId are related with the table Users. If I create classes from this db using Linq to Sql Classes I get Class User (Propreties: UserId, Name, Messages, Messages1) Class Message (Properties: MessageId, FromId, ToId, User, User1, ...) My questions: 1. I would like to rename User and User1 to "To" and "From", how do I know which one is To and which one is From, 2. Circular dependencies are bad.. should I remove Messages and Messages1 from the Usre clsas?

    modified on Thursday, September 10, 2009 10:46 PM

    L 1 Reply Last reply
    0
    • Q Quake2Player

      Hi, Lets say I have a db with two tables: Table Users (UserId, Name) Table Messages (MessageId, FromId, ToId, ...) FromId and ToId are related with the table Users. If I create classes from this db using Linq to Sql Classes I get Class User (Propreties: UserId, Name, Messages, Messages1) Class Message (Properties: MessageId, FromId, ToId, User, User1, ...) My questions: 1. I would like to rename User and User1 to "To" and "From", how do I know which one is To and which one is From, 2. Circular dependencies are bad.. should I remove Messages and Messages1 from the Usre clsas?

      modified on Thursday, September 10, 2009 10:46 PM

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Rename it in tables.after that delete existing tables from dbml file,and add it againg in dbml file.

      Thanks and Regards Sujit Kr. Mandal

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups